try: for i in range(29, -1, -1): print(2**i) if int(input()) == 0: break except EOFError: pass