import numpy as np



N = int(eval(input()))



expo = []

for i in range(1,10000):

    if i == 1:

        expo.append(i)

    else:

        for j in range(2,1000):

            tmp = i**j

            if tmp > N:

                break

            expo.append(tmp)

expo.sort()



expo = np.array(expo)



print((max(expo[expo<=N])))
nums = []



for i in range(1,100):

    for j in range(2,100):

        nums.append(pow(i,j))

    

nums.sort(reverse=True)



X = int(eval(input()))



for i in nums:

    if i <= X:

        print(i)

        break
import numpy as np

N = int(eval(input()))
expo = []
for i in range(1, 10000):
    if i == 1:
        expo.append(i)
    else:
        for j in range(2, 1000):
            tmp = i**j
            if tmp > N:
                break
            expo.append(tmp)
expo.sort()
expo = np.array(expo)
print((max(expo[expo <= N])))

nums = []
for i in range(1, 100):
    for j in range(2, 100):
        nums.append(pow(i, j))
nums.sort(reverse=True)
X = int(eval(input()))
for i in nums:
    if i <= X:
        print(i)
        break

-import numpy as np - -N = int(eval(input())) -expo = [] -for i in range(1, 10000): -    if i == 1: -        expo.append(i) -    else: -        for j in range(2, 1000): -            tmp = i**j -            if tmp > N: -                break -            expo.append(tmp) -expo.sort() -expo = np.array(expo) -print((max(expo[expo <= N]))) +nums = [] +for i in range(1, 100): +    for j in range(2, 100): +        nums.append(pow(i, j)) +nums.sort(reverse=True) +X = int(eval(input())) +for i in nums: +    if i <= X: +        print(i) +        break