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.
import math
x = int(input())

ans = int(math.sqrt(x))

print(ans)
x = int(input())
a = []
for i in range(1,32):
    for j in range(2,11):
        b = i**j
        if b > x:
            break
        a.append(b)
a = list(set(a))
a.sort()

print(a[-1])