M=10**9 for i in range(30): M=(M+1)//2 print(M) if int(input())==0: continue else: exit()