for i in reversed(range(30)): print(2 ** i) if int(input()) != 0: break