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