N = int(eval(input()))



for i in range(8,0,-1):

  if(2**i <= N):

    print((2**i))

    break

else:

  print((1))
N = int(eval(input()))



tmp = 0

for i in range(2,N+1,2):

  cnt = 0

  while True:

    if(i%2 != 0):

      break

    cnt += 1

    i //= 2

  tmp = max(tmp, cnt)

print((2**tmp))
N = int(eval(input()))
for i in range(8, 0, -1):
    if 2**i <= N:
        print((2**i))
        break
else:
    print((1))

N = int(eval(input()))
tmp = 0
for i in range(2, N + 1, 2):
    cnt = 0
    while True:
        if i % 2 != 0:
            break
        cnt += 1
        i //= 2
    tmp = max(tmp, cnt)
print((2**tmp))

-for i in range(8, 0, -1): -    if 2**i <= N: -        print((2**i)) -        break -else: -    print((1)) +tmp = 0 +for i in range(2, N + 1, 2): +    cnt = 0 +    while True: +        if i % 2 != 0: +            break +        cnt += 1 +        i //= 2 +    tmp = max(tmp, cnt) +print((2**tmp))