x, mx = int(eval(input())), 1

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

    for j in range(2,100):

        if i**j<=x: mx=max(mx, i**j)

print(mx)
beki = [0] * 1010

beki[1] = 1

for i in range(2, 1001):

        t = i*i

        while t<1001:

                beki[t] = 1

                t *= i

ans = 1

for i in range(int(eval(input()))+1):

        if beki[i]: ans = i

print(ans)
x, mx = int(eval(input())), 1
for i in range(2, x + 1):
    for j in range(2, 100):
        if i**j <= x:
            mx = max(mx, i**j)
print(mx)

beki = [0] * 1010
beki[1] = 1
for i in range(2, 1001):
    t = i * i
    while t < 1001:
        beki[t] = 1
        t *= i
ans = 1
for i in range(int(eval(input())) + 1):
    if beki[i]:
        ans = i
print(ans)

-x, mx = int(eval(input())), 1 -for i in range(2, x + 1): -    for j in range(2, 100): -        if i**j <= x: -            mx = max(mx, i**j) -print(mx) +beki = [0] * 1010 +beki[1] = 1 +for i in range(2, 1001): +    t = i * i +    while t < 1001: +        beki[t] = 1 +        t *= i +ans = 1 +for i in range(int(eval(input())) + 1): +    if beki[i]: +        ans = i +print(ans)