import math

n = int(eval(input()))

x = int(math.log2(n))

print((2**x))
n = int(eval(input()))

ansc = 0

ans = 0

if n == 1:

    print((1))

    exit()

for i in range(1,n+1):

    x = i

    cnt = 0

    while x % 2 == 0:

        cnt += 1

        x /= 2

        if cnt > ansc:

            ansc = cnt

            ans = i

print(ans)
import math

n = int(eval(input()))
x = int(math.log2(n))
print((2**x))

n = int(eval(input()))
ansc = 0
ans = 0
if n == 1:
    print((1))
    exit()
for i in range(1, n + 1):
    x = i
    cnt = 0
    while x % 2 == 0:
        cnt += 1
        x /= 2
        if cnt > ansc:
            ansc = cnt
            ans = i
print(ans)

-import math - -x = int(math.log2(n)) -print((2**x)) +ansc = 0 +ans = 0 +if n == 1: +    print((1)) +    exit() +for i in range(1, n + 1): +    x = i +    cnt = 0 +    while x % 2 == 0: +        cnt += 1 +        x /= 2 +        if cnt > ansc: +            ansc = cnt +            ans = i +print(ans)