X = 1000000000 print(X) while not int(input()): X //= 2 print(X)