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