s="" for c in`input()`: s+=c if int(s)%7<1:print s;s=""