peterverebics/CodeNet_Python_118 huggingface dataset:
#!/usr/bin/env python3

def solve(x):
    if x == 1:
        return 1
    f = 2
    l = [1]
    while f * f <= x:
        d = f
        while d <= x:
            l.append(d)
            d *= f
        f += 1
    return max(l)



def main():
    X = int(input())
    print(solve(X))
    return

if __name__ == '__main__':
    main()
import math
X = int(input())
ans = 1
Y = math.floor(math.sqrt(X))
for i in range(2, Y+1):
    for j in range(2, 10):
        a = i**j
        if a <= X:
            ans = max(ans, a)
print(ans)
X = int(input())
se = set(n**e for n in range(32) for e in range(2,11) if n**e <= X)

answer = max(se)
print(answer)
#!/usr/bin/env python3

def main():
    X = int(input())
    A = []
    for b in range(1, 1000):
        for p in range(2, 1000):
            if b**p <= X:
                A.append(b**p)
            else:
                break
    print(max(A))


main()
import math
X = int(input())
beki = []
beki.append(1)
Xruto = math.sqrt(X)
Xruto = math.floor(Xruto)
for i in range(2, Xruto+1):
    for j in range(10):
        a = pow(i, j)
        if a <= X:
            beki.append(a)
        else:
            break
print(max(beki))
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    x = int(readline())
    s = set()

    for i in range(1, 1001):
        for j in range(2, 16):
            if i ** j <= x:
                s.add(i ** j)
            else:
                break

    l = list(s)
    l.sort(reverse=True)

    print(l[0])


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

print(max([pow(b, p) for b in range(1, 1001) for p in range(2, 11) if pow(b, p) <= X]))
x = int(input())
cnt = []
for b in range(1, int(x**0.5)+1):
    for p in range(2, 11):
        if b**p <= x:
            cnt.append(b**p)
            
print(max(cnt))
X = int(input())
ans = 0
for i in range(1, 33):
    for j in range(2, 11):
        if i**j > X:
            break
        ans = max(ans, i**j)
print(ans)
X = int(input())
l = []
if X == 1:
    print(1)
else:
    for b in range(2, int(X ** 0.5) + 1):
        for p in range(2, 2 ** 10):
            if b **p <= X:
                l.append(b ** p)
    print(max(l))
X = int(input())

ans = 0
for b in range(1, X + 1):
    p = 2
    while b ** p <= X:
        ans = max(ans, b ** p)
        if b == 1: break
        p += 1

print(ans)
def main():
    x = int(input())
    ans = 0
    d = 0
    if x == 1:
        return 1
    for i in range(2, x):
        d = i
        p = 2
        while d ** p <= x:
            ans = max(ans, d ** p)
            p += 1
    return ans


if __name__ == '__main__':
    print(main())
X = int(input())
ans = {1}
for i in range(2, 40):
    y = 2
    while i ** y <= X:
        ans.add(i ** y)
        y += 1
print(sorted(list(ans))[-1])
x = int(input())
ans = 0
for i in range(1,100)[::-1]:
  for j in range(2,11)[::-1]:
    if i**j <= x:
      ans = max(ans, i**j)
print(ans)
def main():
    x = int(input())
    answer = 1
    b = 2
    while b <= x:
        p = 2
        while pow(b, p) <= x:
            answer = max(answer, pow(b, p))
            p += 1
        b += 1
    print(answer)


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

ans = [1]
for i in range(2, 1001):
  p = 2
  while i**p <= 1000:
    ans.append(i**p)
    p += 1
while not x in ans:
  x -= 1
print(x)
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

x = int(input())

ans = 1

for i in range(2,x+1):
    for j in range(2,11):
        if (ans < i ** j):
            if (i**j <= x):
                ans = i ** j
print(ans)
from math import sqrt
x = int(input())
cnt = 0
l = []
for i in range(1, x + 1):
    for j in range(1, int(sqrt(i)) +1):
        for k in range(2, 10):
            if j ** k == i:
                l.append(i)
print(max(l))
import math
X=int(input())

def check_p(X,b):
	p = 0
	while b**(p+1) <= X:
		p+=1
	return b**p

ans=1
for b in range(2,int(math.sqrt(X))+1):
	ans = max(ans,check_p(X,b))

print(ans)
def main():
    X = int(input())
    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)
    
main()
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())

beki = []
for i in range(1,32):
    beki.append(i**2)
for i in range(1,11):
    beki.append(i**3)
for i in range(1,6):
    beki.append(i**4)
for i in range(1,4):
    beki.append(i**5)
for j in range(6,10):
    beki.append(2**j)
    
beki = sorted(beki, reverse=True)
for a in beki:
    if a <= X:
        print(a)
        break
import sys
import math
x = int(input())
ans = 0
for i in range(1, x+1):
    for j in range(2, x+2):
        if pow(i, j) <= x:
            ans = max(pow(i, j), ans)
        else:
            break
print(ans)
k = []
for i in range(1,40):
  for j in range(2,30):
    if i**j <= 1000:
      k.append(i**j)
L = set(k)
P = list(L)
P.sort()
X = int(input())
ans = 0
if X == 1000:
  print(1000)
else:
  for i in range(len(P)):
    if X<P[i]:
      print(ans)
      break
    else:
      ans = P[i]
X = int(input())
ans = 1
for i in range(2,X):
    j = 2
    if i**j > X:
        continue
    while i**j <= X:
        j+=1
    ans = max(ans,i**(j-1))
print(ans)
x,l=int(input()),[0]*1001;l[1]=1
for i in range(2,int(x**0.5)+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
x=int(input())
ans=0
for b in range(1,int(x**(1/2)+1)):
    for p in range(1,11):
        if b**p<=x and b**p>ans:
            ans=b**p
print(ans)
X = int(input())

ans = 1
for i in range(2, X + 1):
    tmp = i ** 2
    while tmp <= X:
        ans = max(ans, tmp)
        tmp *= i
    
print (ans)
x = int(input())
S = set()
S.add(1)
for b in range(2, int(1000**0.5) + 1):
	for p in range(2, 10):
		if b**p > 1000:
			break
		S.add(b**p)
for n in range(x, 0, -1):
	if n in S:
		print(n)
		exit()
def solve():
    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)


if __name__ == "__main__":
    solve()
X = int(input())
ans = 1
for b in range(1,101):
    for p in range(2,10):
        if X >= b**p and b**p > ans:
            ans = b**p
print(ans)
x = int(input())
print(sorted([b ** p if b ** p <= x else 1 for b in range(1, 1001) for p in range(2, 11)])[-1])
x = int(input())

ans = 0
tmp = 1
for i in range(1, int(x**0.5)+1):
    for j in range(2, x):
      tmp = pow(i, j)
      if tmp > x:
          tmp = pow(i, j-1)
          #print(tmp, i, j)
          break

    ans = max(tmp, ans)

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

ans = 1
for i in range(2, X + 1):
    p = 2
    while i ** p <= X:
        ans = max(ans, i ** p)
        p += 1
        #ans = max(ans, i ** p)

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

for i in range(1,1001):
    for j in range(2,1001):
        K = pow(i,j)
        if K > X:
            break
        ans = max(ans,K)

print(ans)
x = int(input())
if x==1:
  print(1)
  exit()
ans = 1
for i in range(x, 0, -1):
  m = i
  div = []
  for j in range(2,int(m**0.5)+2):
    if m%j==0:
      count = 0
      while m%j ==0:
        m //= j
        count += 1
      div.append(count)
  if m!= 1:
    div.append(1)
  count = div[0]
  for c in div:
    if c!= count or count ==1:
      break
  else:
    print(i)
    exit()
print(ans)
n=(int)(input())
ans =1
for i in range(n):
  for j in range(n):
    p=j+2
    if i**p <=n:
      ans=max(ans,i**p)
    else:
      break
print(ans)
def solve():
    X = int(input())

    ans = 0
    if X <= 3:
        ans = 1
    else:
        for b in range(2,100):
            if b ** 2 > X:
                break
            p = 2
            while pow(b,p) <= X:
                p += 1
            else:
                ans = max(ans, pow(b,p-1))
    
    print(ans)

if __name__ == '__main__':
    solve()
x = int(input())
y = 1
for i in range(1,x):
    for j in range(2,x):
        if i**j <= x:
            y = max(y, i**j)
        else:
            break
print(y)
a = int(input())
ans = 0
i = 1
while i*i <= a:
  for j in range(1, 1000):
    if i**j <= a and ans < i**j:
      ans = i**j
    if i**j > a:
      break;
  i += 1
print(ans)
X = int(input())
List = [0]*(X+1)
List[1] = 1
for i in range(2,X+1):
    v = i**2
    while(v<=X):
        List[v]=1
        v*=i
        
for i in range(1,X+1)[::-1]:
    if List[i]==1:
        print(i)
        break
n = int(input())
if  n == 1 or n == 2 or n == 3:
    print(1)
    exit()
while n > 0:
    for i in range(n):
        for j in range(2, 10):
            if n == i**j:
                print(n)
                exit()
    n -= 1
import math
f= False

x=int(input())
for i in range(x):
	for j in range(1, 1+int(math.sqrt(x))):
		for k in range(2,10):
			if x == j**k:
				print(x)
				f=True
				break
		if f:
			break
	if f:
		break
	x-=1
import math as math
n = int(input())
li = [1]
nroot = int(math.sqrt(n))
for i in range(2,nroot+1):
    for j in range(2,100):
        if i**j <= n:
            li.append(i**j)
        else:
            break
print(max(li))
icase=0
if icase==0:
    bpmax=0
    x=int(input())
    for b in range(1,32):
        for p in range(2,10):
            bp=b**p
            if bp<=x:
                bpmax=max(bpmax,bp)
            else:
                break
    print(bpmax)
n = int(input())
li = []

for i in range(1,32):
    for j in range(2,11):
        x = i**j
        if x <= 1000:
            li.append(x)

li.sort()

for i in range(len(li)):
    if li[i] == n:
        print(n)
        exit()
    elif li[i] > n:
        print(li[i-1])
        exit()
X = int(input())

ans = 0



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

print(ans)
import math
X = int(input())
list1 = []

for i in range(2,X+1):
  for j in range(2,int((X + 1)/2)):
    a = math.log10(i)/math.log10(j)
    if a.is_integer():
      list1.append(i)
if list1 == []:
  print(1)
else:
  print(max(list1))
x = int(input())
kouho = {1}
for i in range(2,32):
    p = i**2
    while p <= x:
        kouho.add(p)
        p *= i
print(max(kouho))
x = int(input())

ans_list = [1]

for i in range(2,x+1):
    cnt = 2
    while True:
        tmp = i ** cnt
        if tmp > x:
            break
        ans_list += [tmp]
        cnt += 1
        
    
ans_list.sort()

for i in ans_list[::-1]:
    if i <= x:
        print(i)
        break
X = int(input())
L = []
for i in range(33):
    for j in range(2, 10):
        x = i ** j
        if x <= X:
            L.append(x)

print(max(L))
import math
X = int(input())
maxv = [1]

for i in range(1,32):
    for j in range(2,11):
        if i**j > X:
            if j != 2:
                maxv.append(i**(j-1))
            break

print(max(maxv))
X = int(input())
list = []

if X == 1:
  list.append(1)

#2^2からスタートするため、X=3も例外として加えなければならない
elif X == 2 or X == 3:
  list.append(2)
  
else:
  for b in range(2, X):
    p = 2
    #X自身になったときに処理できないので
    #<=が必要
    while b ** p <= X:
      list.append(b ** p)
      p += 1
      
print(max(list))
x = int(input())
ans = 0
for i in range(x, 0, -1):
  for j in range(2, max(x + 1, 3)):
    if pow(i, j) <= x:
      ans = max(ans, pow(i, j))
    else:
      break
print(ans)
import math
def resolve():
    x = int(input())
    sqrt_x = int(math.sqrt(x))
    al = list()
    for i in range(2, 10):
        for j in range(sqrt_x, 0, -1):
            if j**i <= x:
                al.append(j**i)
                break
    al = sorted(al)
    print(al[-1])
resolve()
X=int(input())

ans=0
for i in range(1,40):
    for j in range(2,100):
        n=pow(i,j)
        if n>X:
            break
        ans=max(ans,n)
        
print(ans)
a=int(input())
result=[]
for i in range(1,a+1):
    for j in range(2,a+1):
        if j>=10:
            continue
        if i**j<=a:
            result.append(i**j)
result.append(1)
print(max(result))
X = int(input())
limit = int(X ** 0.5)
ans = -1
prob_ans = []

if X == 1:
    ans = 1
for i in range(2, limit+1):
    p = 2
    while True:
        tmp = i ** p
        if tmp > X:
            break
        ans = max(ans, tmp)
        p += 1

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

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

ans = [False] * (X + 1)
for i in range(2, X + 1):
    v = i * i
    while v <= X:
        ans[v] = True
        v *= i

for i in range(X, -1, -1):
    if ans[i]:
        print(i)
        exit()
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    X = ini()
    ans = 1
    for p in range(2, X):
        a = p * p
        while a <= X:
            ans = max(ans, a)
            a *= p
    return ans


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

for x in range(1, X):
    for y in range(2, X):
        if x ** y <= X:
            ans = max(ans, x ** y)
        else:
            break

print(ans)
x = int(input())
beki_li = []
for i in range(2, 1001):
    for j in range(2, 10):
        if i ** j < 1001 and i**j <= x:
            beki_li.append(i**j)
        else:
            break
beki_li.append(1)
print(max(beki_li))
x = int(input())

ans = 1
for i in range(2, x):
    if i * i > x:
        break

    now = i
    while now * i <= x:
        now *= i
    if now > ans:
        ans = now

print(ans)
#abc097 b bekijousu
import math

def large_num(n):
    xx=x/n
    p=1
    while xx-n**p>=0:
        p+=1
    if p==1:
        return 0
    else:
        return n**p

x=int(input())
b_last=int(math.sqrt(1000))
num=[i for i in range(2,b_last+1)]

ans=0


if 4>x:
    ans=1
else:
    for i in num:
        ans=max(large_num(i),ans)
print(ans)
x=int(input())
s={1,}
for b in range(2,x):
    for p in range(2,100000):
        tmp=b**p
        if tmp>x:
            break
        s.add(tmp)
print(max(s))
x=int(input())
l=[0]*(x+1)

if x==1:
    print(1)
    exit()
    
for i in range(1,x):
    for j in range(2,1000):
        if i**j>x:
            break
        l[i**j]=1

for i in reversed(range(x+1)):
    if l[i]==1:
        print(i)
        exit()
from bisect import bisect_left
import math
n = int(input())
lst = []
lst.append(1)
for i in range(2, int(math.sqrt(1000)) + 1):
    for j in range(2, 10):
        if i ** j <= 1000 and i ** j not in lst:
            lst.append(i ** j)

lst.sort()
print(lst[bisect_left(lst, n) - 1] if n not in lst else lst[bisect_left(lst, n)])
X = int(input())
res = 0
for b in range(1, 33):
  for p in range(2, 10):
    if b ** p <= X:
      res = max(res, b ** p)
print(res)
import sys
n=int(input())

ans=[]

if n==1:
    print('1')
    sys.exit()

for i in range(n//2):
    for j in range(n//2):
        if i**j<=n:
            ans.append(i**j)

print(max(ans))
def main():
    X = int(input())
    ans = 1
    for i in range(2, X+1):
        for j in range(2, 11):
            if i**j > X:
                break
            else:
                ans = max(ans, i**j)
    print(ans)

if __name__ == "__main__":
    main()
import math
x = int(input())
ans = []
for j in range(1, math.ceil(math.sqrt(x)) + 1):
    for k in range(2,x + 2):
        if j ** k <= x:
            ans.append(j ** k)
print(max(ans))
N=int(input())
m=0
for i in range(1,N-1):
  for j in range(2,N-2):
    if (i**j)<=N:
      if (i**j)>m:
        m=i**j
    else:
      break
print(max(m,1))
x = int(input())

i = 2
ans = 1
while i * i < x:
    j = 2
    while i**j <= x:
        ans = max(ans, i**j)
        j += 1
    i += 1
print(ans)
x=int(input())
a=[]
for i in range(2,11):
    for j in range(1,32):
        a.append(j**i)
a=[l for l in a if l <= x]
print(max(a))
from math import *
x=int(input())
ans=[]
if x<4:
    print(1)
    exit()
for i in range(2,int(sqrt(x))+1):
    t=2
    while i**t<=x:
        ans.append(i**t)
        t+=1
print(max(ans))
a = int(input())
print(max(j ** i for j in range(32) for i in range(2, 10) if j ** i <= a))
X = int(input())
res = 0
for i in range(1, 1000):
    for j in range(2, 1000):
        if i**j <= X:
            res = max(i**j, res)
        else:
            break
print(res)
x = int(input())

ans = 0
if x == 1:
    ans = 1
else:
    for i in range(2, int(x**0.5)+1):
        j = 2
        while True:
            if i**j > x:
                break
            else:
                ans = max(i**j, ans)
                j += 1

print(ans)
X=int(input())
max = 1
for i in range(2,33):
    k = 2
    while True:
        n = i**k
        if n > X:
            break
        if n > max:
            max = n
        k += 1
print(max)
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)
import numpy as np
whole = np.array(list({i**j for i in range(1, 32) for j in range(2, 32) if i**j <= 1000}))
whole.sort()

X = int(input())

print(whole[np.where(whole<=X)].max())
from math import ceil
def main():
    x = int(input())
    r = 0
    for i1 in range(1, ceil(x**0.5) + 1):
        beki = 2
        while True:
            num = pow(i1, beki)
            if num <= x:
                r = max(r, num)
            else:
                break
            if num == pow(i1, beki - 1):
                break
            beki += 1

    print(r)

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

if not ( 1 <= X <= 1000 ):
    sys.exit()

result = 1
for I in range(1,32):
    for J in range(2,10):
        if I ** J <= X and result <= I ** J:
            result = I ** J

print(result)
x = int(input())
b = []
for i in range(2,32):
    for j in range(2, 10):
        b.append(i**j)
b.sort()
ans = 1
for i in b:
    if i <= x:
        ans = i
    else:
        break
print(ans)
n = int(input())

l = [1]

for i in range(1, n+1):
    for j in range(2, int(n**0.5)):
        if n >= i**j:
            l.append(i**j)
            #print(l)
print(max(l))
def answer(x: int) -> int:
    if x < 4 :
        return 1

    result = 1
    for b in range(2, x + 1):
        for p in range(2, x + 1):
            exp = pow(b, p)
            if exp <= x:
                result = max(result, exp)
            else:
                break

    return result


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


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

table = [False] * -~x
table[1] = True
for i in range(2, 32):
    j = i * i
    while j <= x:
        table[j] = True
        j *= i

print(max(i for i in range(x + 1) if table[i]))
x=int(input())
ans=0
num=x+100
for i in range(1,33):
    for j in range(2,11):
        a=x-(i**j)
        if a>=0 and num>a:
            ans=x-a
            num=a
print(ans)
import sys
a = [1]
for i in range(2,34):
    for j in range(2,13):
        if i**j <= 1000 : 
            a.append(i**j)   
x = int(input())
for k in range(x,0,-1):
    if k in a:
        print(k)
        sys.exit()
import math
x = int(input())
ans = 0
for b in range(1, int(math.sqrt(x))+1):
    p = 1
    if b != 1:
        while b**p <= x:
            p += 1
    if b**(p-1) > ans:
        ans = b**(p-1)
print(ans)
X=int(input())
li=[x**p for x in range(1,32) for p in range(2,35) if x**p<=X]
print(max(li))
x = int(input())

beki = {1}
for b in range(2,32):
    for p in range(2,10):
        if b**p<=x:
            beki.add(b**p)
        else:
            break
            
beki = sorted(beki)
            
print(beki.pop(-1))
# -*- coding: utf-8 -*-

X = int(input())

ans = 1
b = 1
p = 2

while b ** 2 <= X:
    p = 2
    while b ** p <= X and p <= X:
        ans = max(ans, b ** p)
        p += 1
    b += 1

print(ans)
X = int(input())
m = 1
for b in range(2, X):
    p = 2
    while b ** p <= X:
        m = max(b ** p, m)
        p += 1
print(m)
import sys
# input処理を高速化する
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
expo = set()
for i in range(1, 32):
    for j in range(2, 10):
        if i ** j > 1000:
            break
        expo.add(i ** j)
expo = sorted(list(expo), reverse=True)
for e in expo:
    if e <= N:
        print(e)
        exit()
x = int(input())

s = set([1])
for i in range(2,501):
    for j in range(2,10):
        if (i**j) <= x:
            s.add(i**j)

print(max(list(s)))
x = int(input())
a = []
if x==1:
    print(1)
else:
    for b in range(1,x+1):
        for i in range(2,x+1):
            c = b**i
            if c>x:
                break
            else:
                a.append(c)
    print(max(a))
from math import sqrt
X = int(input())
c = 1
for b in range(1,int(sqrt(X)+1)):
    for p in range(2,X):
        if b**p<=X: c = max(c,b**p)
print(c)
x = int(input())

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

print(ans)
x = int(input())
mx = 0
for b in range(1, int(1000 ** 0.5) + 1):
    for p in range(2, 10):
        if mx < b ** p <= x:
            mx = b ** p
print(mx)
x = int(input())
ans = 1
cnt = 1
for i in range(1,x):
    cnt = i
    for j in range(9):
        cnt *= i
        if cnt > x:
            break
        if cnt > ans:
            ans = cnt
print(ans)
import math
x = int(input())

L = []
for i in range(2,int(math.floor(math.sqrt(x)))+1):
  for j in range(x//i + 1):
    if i ** j <= x:
      L.append(i ** j)
      
if L == []:
  print("1")
else:
  print(max(L))
# まあ探索しましょうや 最低の2でも10回やりゃ1000越えるんだし
ans = 0
x = int(input())
if x == 1:
    print(1)
    exit()
for b in range(2, int(x * 0.5) + 1):
    p = 2
    while True:
        if b ** p > x:
            break
        ans = max(ans, b ** p)
        p += 1
print(ans)
x = int(input())
maxx = 1
for i in range(1, x):
  for j in range(2, x):
    expx = i ** j
    if expx <= x:
      if maxx <= expx:
        maxx = expx
    else:
      break
print(maxx)
X = int(input())
ans = []
for b in range(1, 100):
    for p in range(2, 50):
        ans.append(b**p)
ans = [i for i in ans if i <= X]
ans.sort(reverse = True)
print(ans[0]) if X!=1 else print(1)
X = int(input())

output = 1
for i in range(1,32):
    for j in range(2, 10):
        p = i ** j
        if p > X:
            break
        if p > output:
            output = p
print(output)
n=int(input())
res=1
k=1
for b in range(1,int(n**0.5)+1):
    for p in range(2,n):
        if b**p>n:
            break
        else:
            res=max(res,b**p)
print(res)
X = int(input())
ans = 1

for a in range(2, X+1):
    p = 2
    
    while a**p<=X:
        ans = max(ans, a**p)
        p += 1

print(ans)
MAX = 35
N = int(input())
ans = 1
for i in range(2,MAX+1):
  t = i*i
  while t <= N:
    ans = max(ans,t)
    t *= i
print(ans)
X = int(input())
ans = 1
for i in range(2, 32):
    for j in range(2, 10):
        if i ** j > X:
            continue
        ans = max(ans, i ** j)
print(ans)
a = int(input())
mx = 1

for i in range(2,a):
    j=2
    while i**j <= a:
        mx = max(i**j,mx)
        j+=1

print(mx)
x = int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:
            c=max(c,b**p)
        else:break
print(c)
def actual(X):
    pow_nums = [1]

    for i in range(2, 40 + 1):
        for j in range(2, 40 + 1):
            if i ** j <= 1000:
                pow_nums.append(i ** j)

    pow_nums = sorted(set(pow_nums))

    return [pow_num for pow_num in pow_nums if pow_num <= X][-1]


X = int(input())
print(actual(X))
x=int(input())
ans=[1]
for i in range(1,x+1):
    for j in range(2,35):
        if i**j<=x:
            ans.append(i**j)
#print(ans)
print(max(ans))
#解答
x = int(input())
c = 1
for b in range(1, x):
    for p in range(2, x):
        if b**p <= x: c = max(c, b**p)
        else: break
print(c)
x = int(input())
ans = 1
for b in range(2,int(x**0.5)+1):
  for p in range(2,10):
    c = b**p
    if c > x:
      break
    ans = max(ans,c)
print(ans)