x = 10**9 while True: x //= 2 print(x) r = int(input()) if r != 0: break