N=int(eval(input()))

div=1

index=0

while div<=N:

    index+=1

    div=2**index

print((div//2))
N=int(eval(input()))

div=1

while div*2<=N:

    div*=2

print(div)
N = int(eval(input()))
div = 1
index = 0
while div <= N:
    index += 1
    div = 2**index
print((div // 2))

N = int(eval(input()))
div = 1
while div * 2 <= N:
    div *= 2
print(div)

-index = 0 -while div <= N: -    index += 1 -    div = 2**index -print((div // 2)) +while div * 2 <= N: +    div *= 2 +print(div)