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.

-----Constraints-----
 - 1 ≤ X ≤ 1000
 - X is an integer.

-----Input-----
Input is given from Standard Input in the following format:
X

-----Output-----
Print the largest perfect power that is at most X.

-----Sample Input-----
10

-----Sample Output-----
9

There are four perfect powers that are at most 10: 1, 4, 8 and 9.
We should print the largest among them, 9.

Difficulty: introductory

Starter code:

Solutions:
x=int(input())
m=-1000
if 1<=x<=3:
  print((1))
  return
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)



#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math

#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
x = I()
ans = -1
for b in range(1,x+2):
    for p in range(2, x+2):
        if b**p > x:
            break
        ans = max(ans, b**p)
print(ans)


from math import *

x = int(input())

lst1 = list(range(2, int(sqrt(1000)) + 1))
lst2 = [1, 1000]

for n in lst1:
   i = 2
   while n ** i < 1000:
      lst2.append(n ** i)
      i += 1

lst2 = list(set(lst2))
lst2.sort()

for i in range(len(lst2)):
   if x < lst2[i]:
      print(lst2[i - 1])
      return

print(lst2[-1])

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)

x = int(input())
# p >= 2, b >= 1
if x == 1:
    ans = 1
else:
    ans = 0
    for i in range(1, x+1):
        for j in range(2, x+1):
            e = i**j
            if e <= x:
                ans = max(ans, e)
            else:
                break
print(ans)

n = int(input())
t = [1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100,
     125, 121, 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, 1024, 1296]

res = 0
for tt in t:
    res = tt if tt <= n else res
print(res)



X = int(input())

i = 2

ans = 1
while i < X:
    power = 2
    while power <= X:
        if pow(i,power) <= X:
            ans = max(ans,pow(i,power))
        else:
            break
        power += 1
    i += 1
print(int(ans))

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

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)

n = int(input())
s = set()
for i in range(1, 32):
    s.add(i ** 2)

for i in range(1, 11):
    s.add(i ** 3)

for i in range(1, 7):
    s.add(i ** 4)

for i in range(1, 5):
    s.add(i ** 5)
    s.add(i ** 6)
    s.add(i ** 7)
    s.add(i ** 8)
    s.add(i ** 9)
    s.add(i ** 10)

t = list(s)
t.sort()
t = [x for x in t if x <= 1000]

res = 0
for tt in t:
    res = tt if tt <= n else res
print(res)

X = int(input())

ans = 0
for i in range(1, int(X**0.5)+1):
    for j in range(2, 1000):
        tmp = pow(i, j)
        if tmp > X:
            break
        ans = max(ans, tmp)

print(ans)

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)

x = int(input())
print((max([pow(i, j) for i in range(1, 32)
           for j in range(2, 10) if pow(i, j) <= x])))


n = int(input())
ans = 1
for i in range(1,n):
    for j in range(2,n):
        if i ** j <= n:
            ans = max(ans,i ** j)
        else:
            break
print(ans)

x = int(input())
a = 1
for i in range(2, x + 1):
    for j in range(1, x + 1):
        if j ** i <= x:
            a = max(a, j ** i)
        else:
            break
print(a)

X = int(input())
n = 1
if X<=3:
    print(1)
elif X==4:
    print(4)
else:
    n = 4
    for i in range(2,int(X**0.5)+1):
        b = i
        k = 1
        while b**k<=X:
            k += 1
        k -= 1
        if k>=2:
            n = max(n,b**k)
    print(n)

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x = ri()
max_ = 0
for i in range(int(x**0.5), 0, -1):
    for j in range(1, 10):
        if i**j <= x:
            max_ = max(i**j, max_)
        else:
            break
print(max_)












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)

b=[0]*1001
x=int(input())
b[1]=1
for i in range(2,1000,1):
    j=i*i
    while j<1001:
        b[j]=1
        j*=i
for i in range(x,0,-1):
    if b[i]==1:
        print(i)
        break

def solve(X):
    ans = 1

    for i in range(1, 32):
        for j in range(2, 11):
            tmp = i ** j
            if tmp <= X and ans < tmp:
                ans = tmp

    return ans


def __starting_point():
    X = int(input())
    print((solve(X)))

__starting_point()

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)))


def __starting_point():
    main()

__starting_point()

X = int(input())
S = set([1])
for i in range(2,X):
  b = 2
  while(i**b<=X):
    S.add(i**b)
    b += 1

ans = max(S)
print(ans)

x = int(input())
expotential = [0] * (x + 1)
expotential[1] = 1
for b in range(2, x+1):
	t = b * b
	while(t <= x):
		expotential[t] = 1
		t *= b
for i in range(x, 0, -1):
	if expotential[i]:
		print(i)
		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 i in range(2, 32):
    for j in range(2, 10):
        if i ** j > X:
            continue
        ans = max(ans, i ** j)
print(ans)


import sys, math
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
x, = [int(num) for num in lines.pop(0).split(" ")]
max_base = int(math.sqrt(x))
max = 1
for base in range(2, max_base + 1):
    i = 2
    while True:
        tmp_max = base ** i
        if tmp_max <= x:
            if tmp_max > max:
                max = tmp_max
            i += 1
        else:
            break
print(max)


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)

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())
tmp = 1
for b in range(1, x):
    for p in range(2,x):
        if b**p <= x:
            tmp = max(tmp, b**p)
        else:
            break
print(tmp)



X = int(input())
res_list = [1]

for i in range(1,X):
    for j in range(2,X):
        if i ** j <= X:
            res_list.append(i ** j)
        else:
            break

print(max(res_list))

x=int(input())
ans = 0
for i in range(1,32):
  for j in range(2,11):
    if i**j <= x:
      ans = max(ans,i**j)
print(ans)

x = int(input())
pr = [1]
for i in range(2,32):
    for j in range(2,10):
        if (i**j <= 1000)&(i**j not in pr):
            pr.append(i**j)
print(max([k for k in pr if k <= x]))

X = int(input())
lst = [1]
for i in range(2, 32):
    for j in range(2, 10):
        x = i ** j
        if x <= 1000:
            lst.append(x)
if X in lst:
    print(X)
else:
    lst.append(X)
    lst2 = sorted(lst)
    n = lst2.index(X)
    print(lst2[n-1])

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())
if x == 1000:
    print(1000)
    return
list_exp = []
max_b = int(1000 ** 0.5)
max_p = 0
while True:
    if 2 ** max_p > 1000:
        break
    else: max_p += 1

for b in range(1, max_b + 1):
    for p in range(2, max_p):
        if b ** p <= 1000: list_exp.append(b ** p)
        else: break
list_exp.sort()
for i in range(0, len(list_exp)):
    if list_exp[i] <= x: continue
    else:
        print(list_exp[i - 1])
        break

            
X=int(input())

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

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

while True:
    a=prime_factorize(X)
    temp=[]
    c=1
    sw=True
    if len(a)==1:
        sw=False
    for i in range(len(a)-1):
        if a[i]!=a[i+1]:
            temp.append(c)
            c=0
        c+=1
    temp.append(c)

    for j in range(len(temp)-1):
        if temp[j]!=temp[j+1] or temp[j]==1:
            sw=False
    if sw==True:    
        print(X)
        return
    X-=1


X=int(input())
ans=1
for i in range(2,int(X**0.5)+1):
    x=i
    while x<=X:
        ans=max(ans,x)
        x*=i
print(ans)


X = int(input())
exps = []
for b in range(1,34):
  for p in range(2,11):
    x = b**p
    if x < 1001:
      exps.append(x)
exps = list(set(exps))
exps.sort()
for a in exps[::-1]:
  if X >= a:
    print(a)
    break

X = int(input())

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

print(ans)

import bisect
x = int(input())
a = 2
b = 2
k = {1}

while a <= 31:
	while pow(a, b) <= 1000:
		k.add(pow(a, b))
		b += 1
	b = 2
	a += 1

kl = list(k)
kl.sort()
print(kl[bisect.bisect_right(kl, x)-1])

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)


X = int(input())

ans = 0
for i in range(1, int(X**0.5)+1):
    for j in range(2, 1000):
        tmp = pow(i, j)
        if tmp > X:
            break
        ans = max(ans, tmp)

print(ans)

x = int(input())
li = []
for i in range(1,100):
    for j in range(2,12):
        if i ** j <= x:
            if i**j not in li:
                li.append(i**j)
print(max(li))

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)

def __starting_point():
    main()

__starting_point()

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    n = int(input())
    answers=[]

    if n<=3:
        print(n)
        return

    for b in range(2,n):
        #b**2からb**10まで調べる
        for p in range(2,11):
            if b**p > n:
                break
            elif b**p <=n:
                answers.append(b**p)
            else:
                continue
    print(max(answers))
                

def __starting_point():
    main()
__starting_point()

x = int(input())
ans = 1
for i in range(1,x):
    for j in range(2,x):
        if i**j <= x :
            ans = max(ans,i**j)
        else : break

print(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)

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)))


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())
res=0
for b in range(x+1):
    for p in range(2,x+2):
        if res<(b**p)<=x:
            res=b**p
        elif b**p>x:
            break
print(res)



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)


import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
num = []
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

N = k()
if N == 1:
    print(1)
    return
 
for i in range(N,-1,-1):
    for j in range(1,int(N**0.5)+1):
        for k in range(2,11):
            if j**k == i:
                print(i)
                return

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])))


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)

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
x = I()
ans = 1
for b in range(2,1001):
    for p in range(2,24):
        if b**p <= x:
            ans = max(ans,b**p)
        else:
            break
print(ans)


x = int(input())
ans = 1
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

print(ans)

#!/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)


def __starting_point():
    main()

__starting_point()

X = int(input())
ans = 1
for i in range(2, X + 1):
    for j in range(2, X + 1):
        a = i ** j
        if a > X:
            break
        elif a > ans:
            ans = a
print(ans)

x=int(input())
c=1
for b in range(1,32):
    for p in range(2,10):
        if b**p<=x:
          c=max(c,b**p)
        else:break
print(c)

x = int(input())
ans = 0
for i in range(1,32):
    for j in range(2,10):
        if i**j <= x:
            ans = max(ans,i**j)
print(ans)

x = int(input())
ex = [0 for i in range(1001)]
ex[1] = 1

for i in range(2, 1001):
  tmp = i * i
  while tmp <= 1000:
    ex[tmp] = 1
    tmp *= i
  
for i in range(x, 0, -1):
  if ex[i] == 1:
    print(i)
    break


a = int(input())
print(max(j ** i for j in range(32) for i in range(2, 10) if j ** i <= a))

n=int(input())
ans=1
for b in range(2,100):
    tmp=b
    for p in range(2,10):
        tmp*=b
        if tmp<=n :
            ans=max(ans,tmp)
print(ans)

n = int(input())
print(max([pow(i, j) for i in range(1, 32)
           for j in range(2, 10) if pow(i, j) <= n]))

x = int(input())

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

from bisect import bisect_right


cands = []
for i in range(2, 400):
    cur = i
    while cur * i <= 1000:
        cands.append(cur * i)
        cur *= i
cands.sort()

X = int(input())
if X == 1:
    print((1))
else:
    print((cands[bisect_right(cands, X) - 1]))


x=int(input())
ans = 0
for i in range(2,11):
    for j in range(1,x+1):
        if x>=j**i:
            ans = max(ans,j**i)
print(ans)

x = int(input())
max_val = 1
for i in range(1, x):
    for j in range(2, x):   
        val = i ** j
        if val > x:
            break
        elif val > max_val:
            max_val = val
print(max_val)

X = int(input())

maxi = 0

if X < 4:
    print(1)
    return

for i in range(1, X+1):
    for j in range(2, X+1):
        if i**j <= X and i**j >= maxi:
            maxi = i**j
        if i**j > X:
            break

print(maxi)

x = int(input())

ans = 0
for i in range(1, 100):
    for j in range(2, 100):
        y = pow(i, j)
        if y <= x:
            ans = max(ans, y)

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())
cnt = 1
for b in range(1,X):
    for p in range(2,X):
        if b**p <= X:
          cnt = max(cnt, b**p)
        else: break
print(cnt)

x = int(input())
ans = 0
for i in range(1, 100):
    for j in range(2, 10):
        a = i**j
        if a <= x and x-a <= x-ans:
            ans = a
print(ans)

X = int(input())
ans = []
for i in range(1,X+1):
  A = 0
  p = 2
  if i == 1:
    ans.append(1)
  else:
    while True:
      A = i**p
      if A <= X:
        ans.append(A)
        p += 1
      else:
        break
print(max(ans))

X = int(input())

i = 2

ans = 1
while i < X:
    power = 2
    while i**power <= X:
        ans = max(ans,i**power)
        power += 1
    i += 1
print(int(ans))

n = int(input())
import math as m
if n < 4:
  print((1))
  return
  
perfect = 1
for b in range(2,int(n**0.5)+1):
  p = int(m.log(n,b))
  x = b**(p+1)
  if x > n:
    x = b**p
  perfect = max(perfect,x)
  #print(b,x)
  if perfect == n:
    break

print(perfect)


ans = []
X = int(input())
for i in range(1,50):
  for j in range(2,20):
    if (i ** j)<= X:
      ans.append(i**j)
print(max(ans))

X = int(input())

max_expo = 1

for p in range(2,10):
  for b in range(X):
    if max_expo < (b**p) <= X:
      max_expo = (b**p)
print(max_expo)

import bisect
a = int(input())
b = [1]
for i in range(2,34):
  j = 2
  while i**j <= 1000:
    b.append(i**j)
    j += 1
c = sorted(b)
index = bisect.bisect_right(c,a)
print((c[index-1]))



import sys
 
X = int(sys.stdin.readline())
ans = 0
for i in range(X+1):
    for j in range(2, 11):
        tmp = pow(i, j)
        if tmp <= X:
            ans = max(ans, tmp)
print(ans)

n = int(input())
a = {1}
for b in range(2,n):
  p = 2
  x = b**p
  while x <= n:
    a.add(x)
    x = b**p
    p += 1

print(max(a))

X = int(input())
b = 2
p = 2
ans = 1
for b in range(1, X+1):
    for p in range(2, X+1):
        beki = b ** p
        if beki <= X:
            ans = max(ans, beki)
        else:
            break
print(ans)


x=int(input())
ans=0
if x==1:
  print(1)
  return
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)

import math
X = int(input())

ls = []
for i in range(2,math.floor(math.sqrt(X))+1):
  for j in range(2,10):
    if i ** j <= X:
      ls.append(i ** j)
      
print(max(ls) if ls else 1)

X = int(input())
ans = []
ans.append(1)
for i in range(2, X):
    a = i*i
    while a <= X:
        ans.append(a)
        a *= i
print((max(ans)))


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
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,32):
    for j in range(2,10):
        tmp=i**j
        if ans<tmp<=X:
            ans=tmp
print(ans)

x = int(input())
ans = 1000000
for b in range(1,32):
    for p in range(2,10):
        if x-b**p < 0:
            continue
        ans = min(ans,abs(x-(b**p)))
print((x-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]
for i in range(2,X+1):
  p = 2
  while i**p <= X:
    ans.append(i**p)
    p += 1
print(max(ans))

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)

a=int(input())
d=0
e=0
for i in range(40):
  b=i+2
  while b<=a:
    b=b*(i+2)
    e=e+1
  c=b/(i+2)
  if e>1:
    if d<=c:
      d=c
      e=0
  else:
    e=0
if d==0:
  print(1)
else:
  print(int(d))

import math
x = int(input())

res = 1
for b in range(2, math.ceil(math.sqrt(x))):
    p = 2
    while b**(p+1) <= x:
        p += 1
    res = max(res, b ** p)
print(res)

X = int(input())

i = 2
ans = 1
while i < X:
    power = 2
    while pow(i,power) <= X:
        ans = max(ans,pow(i,power))
        power += 1
    i += 1
print(int(ans))

x = int(input())
ans = 0
for i in range(x+1):
    for j in range(2,10):
        if i**j <=x:
            ans = max(ans,i**j)
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)))


import sys
n=int(input())

ans=[]

if n==1:
    print('1')
    return

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

print(max(ans))