peterverebics/CodeNet_Python_118 huggingface dataset:
X = int(input())

cand = [1]
for i in range(2, X+1):
    cnt = 0
    x = X
    while x:
        x //= i
        cnt += 1
    if cnt > 2:
        cand.append(i**(cnt-1))
print(max(cand))
x=int(input())
l=[1]
for i in range(2,int(x**0.5)+1):
    j=1
    while i**(j+1)<=x:
        j+=1
    l.append(i**j)

#print(l)
print(max(l))
X = int(input())
ans = 0
for b in range(2, 32):
    for p in range(2, 32):
        if b**p <= X:
            ans = max(ans, b**p)
            
if X==1:
    print(1)
else:
    print(ans)
import math
X = int(input())

sq = int(math.sqrt(X))

m = 1
for b in range(2, sq+1):
    p = 2
    tmp = b ** p
    while tmp <= X:
        m = max(tmp, m)
        p += 1
        tmp = b ** p

print(m)
x = int(input())
ans = 1
y = x**(1/2)
y = int(y)
for i in range(2,y+1):
    j = 1
    while j<=x:
        ans = max(ans,j)
        j*= i

print(ans)
X = int(input())

lst = []
for i in range(1,101):
    for j in range(2,11):
        if i**j > 1000:
            break
        else:
            lst.append(i**j)

for k in range(X):
    if X - k in lst:
        print(X-k)
        break
x=int(input())

ans=1
for i in range(1,x):
  for j in range(2,x):
    if i**j>x:
      break
    ans=max(ans,i**j)
print(ans)
import numpy as np

N = int(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]))
x = int(input())
a = [1,4,8,16,32,64,128,256,512,9,27,81,243,729,
     25,125,625,36,216,49,343,100,1000,121,144,
     169,196,225,289,324,361,400,441,484,529,576,
     676,784,841,900,961]
b =[]
for num in a:
  if x >= num:
    b.append(num)
print(max(b))
X = int(input())
ans = 1

for i in range(1, X+1):
  for j in range(2, X+1):
    num = i ** j
    if num > X:
      break
    if num >= ans: 
      ans = num

print(ans)
x = int(input())
c = 1
for i in range(1,x):
    for j in range(2,x):
        if i**j <= x:
            c = max(c, i**j)
        else:break
print(c)
n = int(input())
ans = 1
for i in range(2, int(n**0.5+1)):
  tmp = i
  while tmp <= n//i:
    tmp *= i
  ans = max(ans, tmp)
print(ans)
x=int(input())
ans=0
for i in range(2,10):
    for j in range(1,1001):
        tmp=j**i
        if tmp <=x:
            ans=max(tmp,ans)
print(ans)
# -*- coding: utf-8 -*-
x = int(input())

ans = 1
for i in range(x + 1):
    for j in range(int(pow(x, 0.5)) + 1):
        for k in range(int(pow(x, 0.5)) + 1):
            if i == pow(j, k) and ans < i:
                ans = i
print(ans)
x = int(input())
ans = 1
for i in range(2, x + 1):
    j = 2
    while i ** j <= x:
        ans = max(ans, i ** j)
        j += 1
print(ans)
X=int(input())
ans=0
for i in range(X+1):
    if i*i<=X:
        sum=i*i
        for j in range(X):
            if i**j>X:
                break
            sum=max(sum,i**j)
    else:
        break
    ans=max(ans,sum)

print(ans)
x = int(input())
ans = 0
for b in range(1, 32): # 1000**0.5より31
    for p in range(2, 10): # log2(1000)より9
        tmp = b**p
        if tmp <= x and tmp >= ans:
            ans = tmp
print(ans)
x = int(input())

ans = 0
for b in range(1, 1001):
    for p in range(2, 1001):
        if b ** p > x:
            break
        ans = max(ans, b ** p)
        
print(ans)
x=int(input())
ans=0
for i in range(1,32):
  for j in range(2,11):
    if pow(i,j)<=x:
      ans=max(pow(i,j),ans)
print(ans)
def main():
    x = int(input())

    ans = 1
    for b in range(2,x):
        p = 2
        while True:
            if b**p>x:
                break
            ans = max(ans,b**p)
            p += 1
    print(ans)


if __name__ == '__main__':
    main()
a = int(input())
b = [1]
for i in range(2, 100):
    for j in range(2,100):
        b.append(i**j)
b.sort()
for i in range(1,len(b)):
    if b[i] > a:
        print(b[i-1])
        break
x = int(input())
ans = 1
for i in range(1,x+1):
  for j in range(2,11):
    if i**j <= x:
      ans = max(ans,i**j)
    else:
      break
print(ans)
X = int(input())

ans = 1
for b in range(1, X + 1):
    for p in range(2, 11):
        a = b ** p
        if a <= X and ans < a:
           ans = a

print(ans)
X=int(input())

MAX=0
for i in range(1,int(X**.5)+3):
  for j in range(2,10):
    if i**j<=X:
      if MAX < i**j:
        MAX = i**j
    else:
      break

print(MAX)
import math
X=int(input())
x=math.floor(math.sqrt(X))
l=list()
for i in range(1,x+1):
  for n in range(1,7):
    if i**n<=X and i**(n+1)>=X:
      l.append(i**n)

print(max(l))
def Exponential(x):

    ans = 0
    if x == 1:
        ans = 1
    else:
        for i in range(1, x + 1):
            for w in range(2, x + 1):
                if i ** w > x:
                    break
                else:
                    ans = max(ans, i ** w)

    return ans

def main():
    x = int(input())
    print(Exponential(x))

if __name__ == '__main__':
    main()
X = int(input())

l = [1]

for b in range(2,32):
    p = 2
    while b**p <= X:
        l.append(b**p)
        p +=1
        
print(max(l))
x = int(input())
ans = 0
for i in range(1,100):
    for j in range(2,10):
        if i**j <= x:
            ans = max(ans,i**j)
print(ans)
x = int(input())
ans = 0
if x == 1 or x == 2 or x == 3:
  print(1)
  exit()
  
for i in range(2,33):
  for k in range(2,10):
    if k == 2 and i**k > x:
      print(ans)
      exit()
    elif i**k <= x:
      ans = max(i**k,ans)
x = int(input())
maxi = 1
for i in range(2,35):
    j = 2
    while i**j<=x:
        maxi = max(maxi,i**j)
        j+=1
print(maxi)
import math
x = int(input())
if x == 1 or x== 2 or x==3:
  print(1)
  exit()

s = math.floor(math.sqrt(x))

def l(k,p):
  q = int(math.floor(math.log(p)/math.log(k)))
  if k ** (1+q) <= p:
    return(1+q)
  else:
    return(q)

ans = 0
for i in range(2,s+1):
  ans = max(ans, i ** l(i,x))
  if ans == x:
    print(x)
    exit()
  
print(ans)
x = int(input())
if x == 1000:
    print(1000)
else :
    for _ in range(1000):
        if all(x**(1/i)!=int(x**(1/i)) for i in range(2, 100)):
            x -= 1
        else :
            print(x)
            break
x = int(input())

expo = [0]*(x+1)
expo[1] = 1

for i in range(2,x+1):
    v = i*i
    while v <= x:
        expo[v] = 1
        v *= i
        
for i in range(x,-1,-1):
    if expo[i]:
        print(i)
        exit()
from bisect import bisect_right
exps = [1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841,
900, 961, 1000]
print(exps[bisect_right(exps, int(input())) - 1])
x=int(input())
l=[]

if x==1:
    print(1)

else:

    for i in range(2,x+1):
        for j in range(1,x+1):
            y=j**i
            if y<=x:
                l.append(y)
            elif y>x:
                break
    print(max(l))
X = int(input())
A = []
for i in range(1,X+1):
    for j in range(2,100):
        if i**j > X:
            break
        A.append(i**j)
print(max(A))
#!/usr/bin/env python3

def main():
    x = int(input())
    ans = 0
    for b in range(1, 1000):
        for p in range(2, 10):
            if x >= b ** p:
                ans = max(ans, b ** p)
    print(ans)


if __name__ == "__main__":
    main()
X=int(input())
a=2
temp=1
ans=1
l=[]
if X==1:
    print(1)
    exit()
else:
    for i in range(2,41):
        for j in range(2,11):
            if i**j<=X:
                l.append(i**j)
print(max(l))
from math import sqrt
x = int(input())
ans = 1
for i in range(2, int(sqrt(x)) + 1):
    n = i * i
    e = 2
    while n <= x:
        e += 1
        n = pow(i, e)
    ans = max(ans, pow(i, e - 1))
print(ans)
import sys
input = sys.stdin.readline
X = int(input())
res = 0
for b in range(1, 1000):
  for p in range(2, 11):
    if pow(b, p) <= X: res = max(res, pow(b, p))
print(res)
n=int(input())
list=[]
for i in range(32):
	for j in range(2,10):
		ans=i**j
		if ans<=n:
			list.append(ans)
print(max(list))
import math

x = int(input())

ans = 1
for i in range(2, math.ceil(math.sqrt(x)) + 1):
    y = i * i
    while y <= x:
        ans = max(ans, y)
        y *= i
print(ans)
import sys
readline = sys.stdin.readline
import math

def main():
    X = int(readline())
    ans = 1
    for b in range(1, math.floor(X**(1/2))+1):
        for p in range(2, 11):
            if b ** p <= X:
                ans = max(ans, b ** p)
    
    print(ans)


if __name__ == '__main__':
    main()
x = int(input())
ans = 1
for i in range(2, x+1):
    tmp = i
    flag = False
    while tmp * i <= x:
        flag = True
        tmp *= i
    if flag:
        ans = max(ans, tmp)

print(ans)
x = int(input())
ans = []

for i in range(1,33):
    for j in range(2,11):
        if x >= i**j:
            ans.append(i**j)
print(max(ans))
import math
X = int(input())

ans = 1
for i in range(int(math.sqrt(X))+1):
    for j in range(int(math.sqrt(X))+1):
        if i**j <= X and ans < i**j:
            ans = i**j
print(ans)
import sys

input = sys.stdin.readline


def main():
    X = int(input())

    ans = 1
    for b in range(2, 32):
        p = 2
        while True:
            y = b ** p
            if y <= X:
                if y > ans:
                    ans = y
                p += 1
            else:
                break

    print(ans)


if __name__ == "__main__":
    main()
X=int(input())
ans=1
for i in range(2,32):
    for j in range(2,10):
        if i**j>ans and i**j<=X:
            ans=i**j
print(ans)
x = int(input())

ans = 1
for i in range(2, int(x**0.5)+1):
  p = 0
  while i**p <= x:
    if i**p > ans:
      ans = i**p
    p += 1

print(ans)
X=int(input())
ans=1
for i in range(1,X+1):
    for j in range(2,50):
        for k in range(2,50):
            if i==j**k:
                ans=j**k
print(ans)
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    x = II()
    if x == 1: print(1); exit(0)
    b = 2; p = 2
    maxv = 0
    while True:
        if b**2 > x: break
        if b**p > x:
            maxv = max(maxv, b**(p-1))
            b += 1; p = 2
            continue
        p += 1
    print(maxv)

if __name__ == '__main__':
    main()
n=input()
l=len(n)
n=int(n)
ans=0
for i in range(2,7*l):
    t=int(n**(1/i))
    for j in range(3):
        if (t+j)**i<=n:
            ans=max((t+j)**i,ans)
print(ans)
x = int(input())
ans = 1
for i in range(2, 1000):
  tmp = 2
  while i**tmp <= x:
    ans=max(ans, i**tmp)
    tmp+=1
    
print(ans)
x = int(input())

maxv = 0
for i in range(1,100):
    for j in range(2,100):
        a = i ** j
        a = max(a, i**j)
        if i ** j <= x and maxv < a:
            maxv = a

print(maxv)
X=int(input())
a=[1]

for i in range(32):
    for j in range(2,10):
        if i**j > X:
            break
        a.append(i**j)

print(max(a))
def main():
    x = int(input())
    ans = 1
    for i in range(2, int(x**0.5)+1):
        n = 2
        while i**n <= x:
            n += 1
        if ans < i**(n-1):
            ans = i**(n-1)
    print(ans)
    

if __name__ == "__main__":
    main()
X = int(input())

# Xは1000以下なので、pは2**10=1024より10まで探索すれば十分
# 同様にbは40程度まで考えれば十分
max_ex = 1
for p in range(2, 10):
  for b in range(1, 40):
    if max_ex < b**p <= X:
      max_ex = b**p
      
print(max_ex)
x = int(input())
ans = 1
for p in range(2, x+1):
    for b in range(1, x+1):
        if b**p <= x:
            ans = max(ans, b**p)
        else:
            break
print(ans)
import math

X = int(input())

dp = [[0] * 100 for _ in range(X + 1)]

maxint = 1

for i in range(2, int(math.sqrt(X)) + 1):
    dp[i][1] = i
    for j in range(2, 100):
        dp[i][j] = dp[i][j - 1] * i
        if dp[i][j] > X:
            maxint = max(maxint, dp[i][j - 1])
            break
            

print(maxint)
x,l=int(input()),[0]*1001;l[1]=1
for i in range(2,x+1):
  if l[i]==0:j=i*i
  while 1:
    if j>x:break
    else:l[j]=1;j*=i
for i in range(x,-1,-1):
  if l[i]==1:print(i);break
from math import floor

x = int(input())

ans = 1
for i in range(2, floor(x ** 0.5) + 1):
    temp = i ** 2
    while temp * i <= x:
        temp *= i
    if temp > ans:
        ans = temp
print(ans)
x = int(input())
ans = 1

for b in range(1, x):
    for p in range(2, x):
        if b**p<=x:ans = max(ans, b**p)
        else:break
print(ans)
X = int(input())
ans = 1
for b in range(1, X):
    for p in range(2, X):
        tmp = b ** p
        if tmp > X:
            break
        if ans < tmp:
            ans = tmp
print(ans)
X=int(input())
ans=1
for a in range(2,33):
  for b in range(2,11):
    if a**b>X:
      break
    if a**b<=X and a**b>ans:
      ans=a**b
print(ans)
x = int(input())
ans = 1
for b in range(1,x):
    for p in range(2,x):
        a = b**p
        if a == a // 1 and a > ans and a <= x:
            ans = a
        if a>x:
            break
    if a > x:
        continue
print(ans)
X = int(input())
ans = 1
for i in range(2,int(X**0.5)+1):
    cnt = 2
    y = i**cnt
    while y<=X:
        ans = max(ans,y)
        cnt +=1
        y = y*i
print(ans)
import math 
x = int(input())
ans = 0

if x ==1:
  print(1)
  
else:
  for i in range(1,x//2):
    for j in range(2,11):
      tmp = i **j
      if tmp <= x:
        ans = max(ans,tmp)
        
  print(ans)
X = int(input())
ans = 1
for i in range(2,X+1):
    for j in range(2,X):
        if i**j <= X:
            ans = max(ans,i**j)
        else:
            break
print(ans)
x=int(input())
ans=0
for i in range(1,35):
  for j in range(2,10):
    t=i**j
    if t<=x:
      ans=max(ans,t)
print(ans)
X = int(input())

ans = 1

for i in range(2,int(X**0.5)+1):
    tmp = 1
    while tmp * i <= X:
        tmp *= i
    ans = max(ans,tmp)
    
print(ans)
# coding: utf-8
# Your code here!

cand=[0,1]
for i in range(2,32):
    temp=i
    while True:
        temp*=i
        if temp<=1000:
            cand.append(temp)
        else:
            break

cand.sort()

X=int(input())

if X==1000:
    print(1000)
    exit()

for i in range(1,len(cand)):
    if X<cand[i]:
        print(cand[i-1])
        exit()
def resolve():
    X = int(input())
    ans = 1
    for b in range(1000 + 1, 1, -1):
        for p in range(2, 10 + 1):
            if b ** p <= X:
                ans = max(ans, b ** p)
    print(ans)


resolve()
N = int(input())
ans = []
for i in range(1,35):
    for j in range(2,11):
        if i**j <= N:
            ans.append(i**j)
print(max(ans))
X = int(input())
p_m = 10
ans = 0
for i in range(2,int(X**0.5)+2):
    for j in range(2,p_m):
        if i**j <= X:
            ans = max(ans, i**j)
if X == 1:
    print(1)
else:
    print(ans)
x=int(input())

ans=1
for b in range(x):
    for p in range(2,x):
        if b**p <= x:
            ans=max(ans,b**p)
        else:
            break
print(ans)
def main():
    x = int(input())
    limit = int(x**0.5)+2
    ans = 0
    for i in range(limit):
        for j in range(2,limit):
            p=i**j
            if p <= x:
                ans = max(ans, p)
            else:
                break
    print(ans)

if __name__ == "__main__":
    main()
X = int(input())

num_list = []
for i in range(1, 33):
    if i ** 2 > X:
        break
    for j in range(2, 11):
        N = i ** j
        if N > X:
            break
        else:
            num_list.append(N)
print(sorted(set(num_list))[-1])
L = [0 for _ in range(1001)]
L[1] = 1
for i in range(2, 32):
  base = i * i
  while base <= 1000:
    L[base] = 1
    base *= i
X = int(input())
while L[X] == 0:
  X -= 1
print(X)
x = int(input())
beki = []

for b in range(1, 32):
    for p in range(2, 10):
        num = b**p
        if num <= x:
            beki.append(num)

beki = sorted(set(beki), reverse= True)

print(beki[0])
import math
x = int(input())
seen = [0] * 1001
ans = 1
for i in range(x):
    if(seen[i]): pass
    cur = i
    if(i > 1):
        while (cur <= x):
            cur *= i
            if(cur <= x): ans = max(ans, cur)
print(ans)
x = int(input())
ans = 0
for i in range(33):
    for j in range(2,11):
        if pow(i,j) > x: break
        ans = max(ans,pow(i,j))

print(ans)
import math

X=int(input())
max=0
for i in range(int(math.sqrt(X))):
    num=i+1
    j=0
    while True:
        buf=pow(num,j)
        if buf>max:
            max=buf
        j=j+1
        if (buf==pow(num,j))or(pow(num,j)>X):
            break
print(max)
x = int(input())
if x == 1:
    print(1)
elif x == 1000:
    print(1000)
else:
    print(int(max(int((x ** (1 / i))) ** i for i in range(2, x + 1))))
import math
k=int(input())
kouho=1
for i in range(2,32):
    for j in range(2,10):
        a=i**j
        if a>k:
            break
        if a>kouho:
            kouho=a
print(kouho)
x=int(input())
maxim=0
for i in range(2,32):
    for j in range(2,10):
        temp=i**j
        if temp<=x and maxim<temp:
            maxim=temp
print(maxim if maxim>0 else 1)
x=int(input())
ans=0
if x==1:
  print(1)
  exit()
for i in range(1,x):
  for j in range(2,10):
    if i**j<=x:
      ans=max(ans,i**j)
    else:
      break
print(ans)
n=(int)(input())
a=[1]
for i in range(2, n):
  temp = i ** 2
  while(temp <= n):
    a.append(temp)
    temp *= i
a = sorted(set(a))
#print(a)
print(list(i for i in a if i <= n)[-1])
x = int(input())
ans = [1]
for i in range(2, x):
  b = i
  p = 2
  while b ** p <= x:
    if b ** p <= x:
      ans.append(b ** p)
    p += 1
print(max(ans))
import math
x=int(input())
if x<4:
    print(1)
else:
    buf=0
    while buf==0 and x>1:
        r=int(math.sqrt(x))
        for i in range(2,r+1):
            ans=1
            while ans<x:
                ans*=i
            if ans==x:
                buf=1
                break
        if buf==0:
            x-=1
    print(x)
X = int(input())

ans = 0

for i in range(2, 9 + 1):
    for j in range(1, 1000 + 1):
        ans_ = j ** i
        ans = max(ans, ans_) if ans_ <= X else ans

print(ans)
x = int(input())
ans = 1
for b in range(1, x):
  for p in range(2, x):
    tmp_ans = b ** p
    if tmp_ans > x:
      break
    ans = max(ans, tmp_ans)
print(ans)
x=int(input())
ans=1
for a in range(2,1000):
    p=2
    while a**p<=x:
        ans=max(ans,a**p)
        p+=1
print(ans)
for i in range(1,int(input())+1)[::-1]:
  for j in range(2,int(i**(1/2))+1):
    if i%j==0:
      temp=i
      while temp%j==0:
        temp//=j
      if temp==1:print(i);exit()
print(1)
x = int(input())
ans = 1
for i in range(1, 36):
    for j in range(2, 10):
        if i**j <= x:
            ans = max(ans, i**j)
        else:
            break
print(ans)
n = int(input())

max_ = 1
for i in range(2, n):
  k = i
  c = 1
  while k <= n:
    k *= i
    c += 1
  if c > 2:
    max_ = max(max_, k//i)
print(max_)
x=int(input())
n=2
for i in range(x,1,-1):
   for j in range(2,x):
        if i<j:
            break
        n=2
        while j**n<=i:
            if j**n==i:
                print(i)
                exit()
            n+=1
print(x)
x = int(input())

ans = 1
for b in range(2,32):
    p = 2
    while b**p <= x:
        ans = max(ans, b**p)
        p += 1
print(ans)
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pri = lambda x: print(*x, sep='\n')

X = int(input())

res = 1
for i in range(2, X):
    if X < i:
        break
    for j in range(2, 10):
        val = pow(i, j)
        if X < val:
            break
        if res < val:
            res = val
print(res)
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    X = int(readline())

    if X <= 3:
        print(1)
        return

    ans = 0
    for n in range(2, X):
        p = 2
        while pow(n, p) <= X:
            if ans < pow(n, p):
                ans = pow(n, p)
            p += 1

    print(ans)
    return


if __name__ == '__main__':
    main()
N = int(input())
ans = 0
for i in range(1,35):
  for k in range(2,10):
    if i**k <= N and i**k >= ans:
      ans = i**k
print(ans)
N = int(input())
ans = 0
for i in range(1, N + 1):
    for j in range(2, 20):
        if i ** j > N:
            continue
        ans = max(i ** j, ans)
print(ans)
import sys
input = sys.stdin.readline
X = int(input())
ans = [1]
for i in range(2, 1 + int(X ** (1/2))):
    ans.append(i)
    x = i
    while x < X:
        x *= i
        if x <= X:
            ans.append(x)
print(max(ans))
pow = [1]
for p in range(2,32):
  i=2
  while p**i<=1000:
    pow.append(p**i)
    i += 1
#print(pow)
X = int(input())
x = X
while x>0:
  if x in pow:
    ans = x
    break
  x -= 1
print(ans)
x=int(input())
m=-1000
if 1<=x<=3:
  print(1)
  exit()
else:
  for b in range(2,x+1):
   for p in range(2,11):
    if x>=b**p:
      m=max(m,b**p)
   

print(m)
x = int(input())

res = []
for i in range(1, 33):
  for j in range(2, 10):
    cand = i ** j
    if x >= cand:
      res.append(cand)
res = sorted(res)
print(res[-1])
X = int(input())
maxnum = 0
for i in range(1, X+1):
    for j in range(2, X+2):
        if i**j > X:
            break
        maxnum = max(maxnum, i**j)
print(maxnum)
p = []
p.extend([i ** 2 for i in range(int(1000**(1/2)) + 1)])
p.extend([i ** 3 for i in range(int(1000**(1/3)) + 1)])
p.extend([i ** 5 for i in range(int(1000**(1/5)) + 1)])
p.extend([i ** 7 for i in range(int(1000**(1/7)) + 1)])
p.sort()
p.append(1000)
p.append(1001)
 
N = int(input())
 
for j in range(len(p) - 1):
  if p[j] <= N < p[j + 1]:
    print(p[j])
X=int(input())

M=1
for b in range(2,X+1):
    if b*b<=X:
        a=b*b
        while a*b<=X:
            a*=b
        M=max(M,a)

print(M)
import itertools
import sys
input = sys.stdin.readline

X = int(input())
ans = 1

for b in range(2, X+1):
    for i in itertools.count(2):
        bp = b ** i
        # print(bp)
        if bp <= X:
            ans = max(ans, bp)
        else:
            break

print(ans)
x = int(input())
lst = [i**2 for i in range(1,32)]+[8,27,125,216,343,512,1000]+[32,243]+[128]+[1001]
lst.sort()
for i in range(len(lst)):
    if lst[i]<=x<lst[i+1]:
        print(lst[i])
r = range(1,32)
x = int(input())
print(max(b**p for p in r[1:] for b in r if b**p <= x))
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

x = inint()

ans = 0

for i in range(1,33):
    for j in range(2,10):
        if ans < i**j <= x:
            ans = i**j

print(ans)
x = int(input())
ans = 0
for a in range(2,x):
  for b in range(2,10):
    if a**b <= x:
        ans = max(ans,a**b)
        #print(a,b)
if x == 1:
    print(1)
    exit()
print(ans)
a = int(input())
m = 1
for i in range(a//2+1):
    for j in range(1,10):
        if a>=i**j and m <i**j:
            m = i**j
        if a < i**j:
            break
print(m)
x = int(input())
if x == 1:
    print(1)
    exit()

for i in reversed(range(1, x + 1)):
    for j in range(2, 101):
        for k in range(2, 101):
            number = j ** k
            if number == i:
                print(i)
                exit()
x = int(input())
ans = 0
for i in range(x):
    for j in range(2,10): 
        if i**j <= x:
            ans = max(ans,i**j)
            #print(ans,i,j)
        else:
            break

if ans == 0:
    ans = 1

print(ans)
X = int(input())
upper = int(X**0.5//1)+1
max = 0
for x in range(1,upper):
  for i in range(9):
    if max < x**(i+1) <= X:
      max = x ** (i+1)
print(max)
#B - Exponential
import math
X = int(input())
def expo(x):
    ans = 1
    for i in reversed(range(1,x+1)):
        for j in range(int(math.sqrt(x))+1):
            for k in range(2,int(math.sqrt(x))):
                if i == j**k:
                    ans = i
                    return ans
    return ans
print(expo(X))
import math

X = int(input())

if X == 1:
    print(1)
    exit()

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if abs(math.log(i, j) - round(math.log(i, j))) <= 0.0000001:
            print(i)
            exit()
    if i == 1:
        print(1)