from sys import stdin

import bisect

from itertools import accumulate

import numpy as np



n = int(stdin.readline().rstrip())



li = [1]



for i in range(2,34):

    for s in range(2,10):

        if i**s <= 1000:

            li.append(i**s)

        else:

            break

    

li = list(set(li))



li.sort()



print((li[bisect.bisect(li,n)-1]))
x = int(eval(input()))

ma = 0

for i in range(1,100):

    for j in range(2,100):

        if i**j <= x:

            ma = max(ma,i**j)

print(ma)
from sys import stdin
import bisect
from itertools import accumulate
import numpy as np

n = int(stdin.readline().rstrip())
li = [1]
for i in range(2, 34):
    for s in range(2, 10):
        if i**s <= 1000:
            li.append(i**s)
        else:
            break
li = list(set(li))
li.sort()
print((li[bisect.bisect(li, n) - 1]))

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

-from sys import stdin -import bisect -from itertools import accumulate -import numpy as np - -n = int(stdin.readline().rstrip()) -li = [1] -for i in range(2, 34): -    for s in range(2, 10): -        if i**s <= 1000: -            li.append(i**s) -        else: -            break -li = list(set(li)) -li.sort() -print((li[bisect.bisect(li, n) - 1])) +x = int(eval(input())) +ma = 0 +for i in range(1, 100): +    for j in range(2, 100): +        if i**j <= x: +            ma = max(ma, i**j) +print(ma)