You are given a positive integer X. Find the largest _perfect power_ that is at most X. Here, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.
x=int(input())
result = []

for i in range(2, x):
    sum = i
    while sum * i <= 1000:
        sum = sum * i
        result.append(sum)

print(result)

x=int(input())
result = [1]

for i in range(2, x):
    sum = i
    while sum * i <= x:
        sum = sum * i
        result.append(sum)

print(sorted(result)[-1])
