n="" for d in raw_input(): n+=d if int(n)%7<1:print n;n=""