n = int(eval(input()))

count = 0

while 2**count <= n:

    count += 1

print((2**(count-1)))
n = int(eval(input()))

count = 0

while 2**count <= n:

    x = 2**count

    count += 1

print(x)
n = int(eval(input()))
count = 0
while 2**count <= n:
    count += 1
print((2 ** (count - 1)))

n = int(eval(input()))
count = 0
while 2**count <= n:
    x = 2**count
    count += 1
print(x)

+    x = 2**count -print((2 ** (count - 1))) +print(x)