X=int(eval(input()))

s=[]

for i in range(1,100,+1):

    for j in range(2,100,+1):

     if i**j<=X:

        s.append(i**j)

print((max(s)))



n=int(eval(input()))



a=[1]

for i in range(2,33):

	for j in range(2,11):

		x=i**j

		if x<=1000:

			a.append(x)



a=list(set(a))

a.sort()

	

def binarySearch(value, xList):

    low=0

    high=len(xList)

    while low!=high:

        mid=(low+high)//2

        if xList[mid]<=value:

            low=mid+1

        else:

            high=mid

    return xList[low-1]

		

print((binarySearch(n,a)))
X = int(eval(input()))
s = []
for i in range(1, 100, +1):
    for j in range(2, 100, +1):
        if i**j <= X:
            s.append(i**j)
print((max(s)))

n = int(eval(input()))
a = [1]
for i in range(2, 33):
    for j in range(2, 11):
        x = i**j
        if x <= 1000:
            a.append(x)
a = list(set(a))
a.sort()


def binarySearch(value, xList):
    low = 0
    high = len(xList)
    while low != high:
        mid = (low + high) // 2
        if xList[mid] <= value:
            low = mid + 1
        else:
            high = mid
    return xList[low - 1]


print((binarySearch(n, a)))

-X = int(eval(input())) -s = [] -for i in range(1, 100, +1): -    for j in range(2, 100, +1): -        if i**j <= X: -            s.append(i**j) -print((max(s))) +n = int(eval(input())) +a = [1] +for i in range(2, 33): +    for j in range(2, 11): +        x = i**j +        if x <= 1000: +            a.append(x) +a = list(set(a)) +a.sort() + + +def binarySearch(value, xList): +    low = 0 +    high = len(xList) +    while low != high: +        mid = (low + high) // 2 +        if xList[mid] <= value: +            low = mid + 1 +        else: +            high = mid +    return xList[low - 1] + + +print((binarySearch(n, a)))