s=input() for c in s: s+=c print(c,end='\n'[:int(s)%7<1])