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