x = 2 ** 29 while 1: print(int(x)) if int(input()) == 0: x /= 2 else: break