# n = int(input()) ans = 1500000000 while True: print(ans) x = int(input()) if x != 0: exit(0) else: ans //= 2