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

ans = 1
for b in range(1, 100):
    for p in range(2, 100):
        if b ** p <= x:
            ans = max(ans, b ** p)

print(ans)
x=int(input())
m=1
if x<=3:
    print(1)
else:
    for p in range(2,12):
        a=2
        while a**p<=x:
            m=max(m,a**p)
            a+=1
    print(m)
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())
A=[1]
for i in range(2,x+1):
    p=2
    if i**p>x:
        break
    while i**p<=x:
        A.append(i**p)
        p+=1
print(max(A))
from math import sqrt
x = int(input())

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

print(ans)
x = int(input())
n = [1]
for i in range(2, 1001):
    p = 2
    while i ** p <= 1000:
        n.append(i ** p)
        p += 1
while not x in n:
    x -= 1

print(x)
x = int(input())
A = [a**b for a in range(1, 35) for b in range(2, 10) if a**b <= x]
A.sort()
print(A[-1])
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())
maxval = 0
for i in range(1,int(x**0.5)+1):
  for j in range(2,8):
    pwr = i**j
    if pwr<=x:
      maxval = max(maxval,pwr)
print(maxval)
x = int(input())
ans = 1
for b in range(1, 1001):
    for p in range(2, 11):
        now = b ** p
        if now <= x:
            ans = max(ans, now)
print(ans)
n = int(open(0).read().rstrip())

exes = {1}

for i in range(2,1001):
    if not i in exes:
        to_add = i
        while to_add * i <= 1000:
            to_add *= i
            exes.add(to_add)

print(max(filter(lambda x:x<=n, exes)))
X = int(input())
A = []
k=20
for i in range(1,int(X**0.5)+1):
    for j in range(k):
        if i**j<=X:
            A.append(i**j)
        elif i++j > X:
            k = j+1
            break
print(max(A))
x = int(input())
ans = 1
for i in range(1,1001):
    for j in range(2,10):
        if(i**j > x) : break
        ans = max(ans,i**j)

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

if x <= 3:
  print(x)
  exit()

ans = 0
for i in range(2, int(x**0.5)+1):
  s = 0
  t = 1
  while i**t <= x:
    s = i**t
    t += 1
  ans = max(ans, s)
print(ans)
x = int(input())
ans = [1]
for i in range(2, 1001):
    p = 2
    while i**p <= x:
        ans.append(i**p)
        p += 1
ans.sort(reverse=True)
#print(ans)
print(ans[0])
n=int(input())
m=-1
for p in range(2,10):
    for b in range(1,32):
        if b**p<=n:
            m=max(m,b**p)
        else:break
print(m)
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)
X = int(input())

ans = 0
for i in range(1, 101):
    for j in range(2, 101):
        if i ** j <= X:
            if i ** j > ans:
                ans = i ** j
print(ans)
n=int(input())

ans = 1

i = 2

while i**2 <= n:
    u = 2
    while i**u <= n:
        ans = max(i**u, ans)
        u += 1
    i += 1
print(ans)
X=int(input())
s=set(pow(i,j) for i in range(40) for j in range(2,10) if pow(i,j)<=X)
print(max(s))
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)
x = int(input())

res = []

for i in range(2, int(x**0.5)+2):
    for j in range(2, 10):
        if i**j <= x:
            res.append(i**j)
if x == 1:
    print(1)
else:
    print(max(res))
x = int(input())

ans = 1
for b in range(1, 34):
    for p in range(2, 34):
        if b**p <= x:
            ans = max(ans, b**p)

print(ans)
a = int(input())
l = [] 

for i in range(100):
    for j in range(2,10):
        if i**j <= a:
            l.append(i**j)
print(max(l))
x = int(input())
n = set()
n.add(1)
for i in range(2,33):
    a = i
    beki = 2
    while a**beki <= x:
        n.add(a**beki)
        beki += 1
        if a**beki > x:
            break

print(max(n))
l = [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]
X = int(input())
while 1:
  if X in l:
    print(X)
    break
  X -= 1
X = int(input())

ans = 0
for i in range(1,40):
    for j in range(2,10):
        if X >= i**j and i**j > ans:
            ans = i**j

print(ans)
s=set()
s.add(1)
x=1001
for i in range(2,1000):
    k=i*i
    while k<x:
        s.add(k)
        k*=i
#print(sorted(s))
l=[i for i in range(1001)]
for i in range(1,1001):
    if i in s:
        l[i]=i
    else:
        l[i]=l[i-1]
print(l[int(input())])
x = int(input())

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

print(ans)
X=int(input())
res=0
for b in range(1,1000):
  for p in range(2,1000):
    if b**p<=X :
      res=max(res,b**p)
    else:
      break
print(res)
X=int(input())
ans=0
for i in range(1,X+1):
	for j in range(2,11):
		t=i**j
		if t<=X:
			ans=max(ans,t)
print(ans)
X = int(input())

res = 1
for i in range(X):
    for p in range(2, X):
        if i ** p <= X:
            res = max(res, i ** p)
        else:
            break
print(res)
x=int(input())
ans=1
for i in range(2,10):
    for j in range(1,1000):
        tmp = j**i
        if tmp <= x:
            ans=max(ans,tmp)

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

lis = []

for i in range(1,1001):
	for j in range(2,11):
		lis.append(i**j)

cand = [i for i in lis if i<=x]

print(max(cand))
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))
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, math.floor(math.log2(X))+1):
            if b ** p <= X:
                ans = max(ans, b ** p)
    
    print(ans)


if __name__ == '__main__':
    main()
x = int(input())
c = [1]
for i in range(2,32):
    num = 2
    while i**num <= x:
        c.append(i**num)
        num += 1
print(max(c))
import math

x = int(input())

ans = 0
exponent = []

for i in range(1,int(math.sqrt(x))+1):
  for j in range(2, int(math.log(x, 2))+1):
    ans = i ** j
    exponent.append(ans)

exponent.sort()
exponent = [i for i in exponent if i <= x]

if x == 1:
  print(1)
else:
  print(max(exponent))
X = int(input())
r = 1
for b in range(2, int(X**(0.5)+1)):
    for p in range(2, 11):
        if b**p > X:
            break
        r = max(r, b**p)
print(r)
x=int(input())
ans=1
for i in range(2,int(x**0.5)+1):
    p=1
    while i*p<=x:
        p*=i
    ans=max(p,ans)
print(ans)
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    x = int(input())
    m = 0
    for i in range(1, 1000):
        for j in range(2, 100):
            k = pow(i, j)
            if k <= x:
                m = max(m, k)
    print(m)


if __name__ == '__main__':
    resolve()
X = int(input())
answer = 0
for b in range(1,100+1):
    for p in range(2,10+1):
        if b**p <= X:
            answer = max(answer, b**p)
print(answer)
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())

l = [1]

for i in range(2, int(x ** 0.5)+1):
    t = 2
    while True:
        if i ** t <= x:
            l.append(i ** t)
            t += 1
        else:
            break

l.sort()

print(l[-1])
x = int(input())

if x == 1:
    print("1")
    exit()


def func(p):
    q = p
    while q < x:
        q *= p
        if q == x:
            return q
    if q / p == p:
        return 1
    else:
        return q // p


z = []
a = 2

while a <= x:
    z.append(func(a))
    a += 1

print(max(z))
def main():
    x = int(input())
    ans = 1
    for i in range(2, int(x**0.5)+1):
        b = i
        p = 1
        while b**(p+1) <= x:
            p += 1
        ans = max(ans, b**p)
    print(ans)

if __name__ == "__main__":
    main()
x = int(input())
ans = 0
for i in range(1,x+1):
    for j in range(2,int(i**0.5)+2):
        if i**(1/j) % 1 == 0:
            ans = i
print(ans)
import sys
n = int(input())
for i in range(n,0,-1):
    if ((i**(1/2))%1 == 0) or ((i **(1/3))%1 == 0) or  ((i **(1/5))%1 == 0) or ((i **(1/7))%1 == 0) or ((i **(1/9))%1 == 0):
        print(i)
        sys.exit()
print(1)
x = int(input())

if x == 1:
    print("1")
    exit()


def func(p):
    q = 1
    while q <= x:
        if q == x:
            return q
            break
        else:
            q *= p
    return q


z = []
a = 2

while a <= x:
    z.append(func(a))
    a += 1

print(max(z))
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,50):
        if i**j<=1000:
            li.append(i**j)
li.sort()
ans = 1
for k in range(len(li)):
    if (li[k-1]<=N)&(li[k]>N):
        ans = li[k-1]
print(ans)
x = int(input())

for i in range(x):
    for j in range(2, 10):
        if (x-i)**(1/j) % 1 == 0:
            print(x-i)
            exit()
import math
def main():
  x = int(input())
  print(int(math.sqrt(x))*int(math.sqrt(x)))
main()
x = int(input())
for i in range(x):
    if i**2 <= x:
        count = i**2
print(count)
import math 
X=int(input())
max_num=0
for i in range(1,10):
  tei=math.floor(X**(1/i))
  if max_num<tei**i:
    max_num=tei**i
print(max_num)
x=int(input())
ans=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x: ans=b**p
        else: break
print(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())

if x == 1:
    print("1")
    exit()


def func(p):
    q = 1
    while q <= x:
        q *= p
    return q / p


z = []
a = 2

while a <= x ** 0.5:
    z.append(func(a))
    a += 1

print(max(z))
N = int(input())
li = []
for i in range(2,100):
    for j in range(2,5):
        li.append(i**j)
li.sort()
ans = 0
for k in range(len(li)):
    if (li[k-1]<N)&(li[k]>N):
        ans = li[k-1]
print(ans)
x = int(input())
ans = 1
for i in range(35):
    for j in range(15):
        if i**j > x:
            break
        else:
            ans = max(i**j,ans)
print(ans)
n = int(input())
a=0
if n > 1:
  a = n//2
else:
  a = n
while True:
  if a**2 <= n:
    print(a**2)
    break
  a -= 1
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

x = int(input())
li = [1]
b = 2
if x == 0:
    print(0)
    sys.exit()
while True:
    if b == 100:
        break
    p = 2
    while True:
        d = b**p
        if d>=x:
            break
        li.append(d)
        p += 1
    b+=1
li.sort()
print(li[-1])
import math
x=int(input())
a=0
if x==1:
    print(1)
    exit()
for i in range(1,math.ceil(math.sqrt(x))):
    a=max(a,i**2)
print(a)
x = int(input())
min = 10000
for i in range(1,1000):
	for j in range(2,40):
		if x-i**j < min and 0 < x-i**j:
			min = x-i**j
if min > 1000:
	print(x)
else:
	print(x-min)
n=int(input())

ans = 1

i = 2

while i**2 <= n:
    u = 2
    while i**u <= n:
        ans = i**u
        u += 1
    i += 1
print(ans)
import math


x = int(input())

ans = 0
for i in range(x):
    if i * i > x: break
    ans = i * i
print(ans)
import math
A = int(input())
B = math.floor(math.sqrt(A))
print(B ** 2)
import math
a = int(input())
for i in range(a, 0, -1):
  for j in range(2, 10):
    if i == int(math.pow(i, 1/j)) ** j:
      print(i)
      break
  else:
    continue
  break
from bisect import bisect_right
a = int(input())
dp = [1]
t = 1

while t**2<=10000:
    dp.append(t**2)
    t+=1
    if dp[-1]==a:
        print(dp[-1])
        exit()
    elif dp[-1] > a:
        print(dp[-2])
        exit()
print(dp[bisect_right(dp,a)-1])
X = int(input())
ans = 0
for i in range(1,X+1):
    for j in range(2,X+1):
        if i**j <= X:
            ans = max(ans,i**j)
        else:
            break
print(ans)
X = int(input())

maxi = 0

if X < 4:
    print(1)
    exit()

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

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

ans = 1
for i in range(2, x+1):
  n = 2
  while i ** n < x:
    ans = i ** n
    n += 1
print(ans)
X=int(input())
ans=0
for i in range(1,X):
    for j in range(2,11):
        tmp=i**j
        if ans<tmp<=X:
            ans=tmp
print(ans)
x = int(input())
if x == 1:
  print("1")
  exit()
  
ans = 0
for b in range(2,int(x**(1/2)+1)):
  for p in range(2,1000):
    tmp = pow(b,p)
    if tmp<=x:
      ans = max(ans,pow(b,p))
      break
      
print(ans)
from math import *
n=int(input())
s=sqrt(n)
s=int(s)
print(s**2)
x=int(input())
ans=1
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**j<=x:
            ans=i**j
print(ans)
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    ret = 0
    for b in range(1, N):
        for p in range(2, N):
            if b ** p <= N:
                ret = max(ret, b ** p)

    print(ret)


if __name__ == '__main__':
    main()
X = int(input())
ans = 1
for b in range(1,101):
    for p in range(2,10):
        if X >= b**p and X > ans:
            ans = b**p
print(ans)
from math import sqrt
X = int(input())
N = int(sqrt(X))
print(N**2)
n =(int)(input())
ans=0
for i in range(n):
  for j in range(n):
    if i**j <= n:
      ans=i**j
print(ans)
a=1
kazu=[]
while 1:
  if a*a>1000:
    break
  kazu.append(a*a)
  a+=1
x=int(input())
for i in range(len(kazu)):
  if kazu[len(kazu)-1-i]<=x:
    print(kazu[len(kazu)-1-i])
    exit()
import math
x = int(input())
ans = 1
for i in range(2, x):
    p_max = math.floor(math.log(x, i))
    if p_max < 2:
        break
    ans = max(ans, i**p_max)
print(ans)
X = int(input())
ans = 0
for b in range(1, X):
    for p in range(2, X):
        tmp = b ** p
        if ans < tmp and tmp <= X:
            ans = tmp
print(ans)
x = int(input())
ans=0
for i in range(1, x+1):
    if i**2<=x:
        ans=i**2
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]))
print(pr)
X = int(input())
Max = 0
for i in range(2,10):
    b = int(X**(1/i))
    B = b**i
    if Max < B:
        Max = B
print(Max)
import math
x = int(input())
for i in range(x,0,-1):
    if math.sqrt(i)%1 == 0  or (math.ceil(i ** (1/3)))**3 == i:
        print(i)
        break
x = int(input())
ans = 1
for i in range(1,x//2):
  for j in range(2,10):
    if i ** j <= x:
      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
    else: break

print(mx)
x=int(input())
print(int(x**(1/2))**2)
x = int(input())

ans = 0
for i in range(x + 1):
    if i * i > x: break
    ans = i * i
print(ans)
x = int(input())

result = 0
for i in range(2,x+1):
  beki = 2
  while (i**beki) <= x:
    result = i**beki 
    beki+=1

if result == 0:
  print(1)
else:
  print(result)
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)
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))
import math
X = int(input())
print((int(math.sqrt(X)))**2)
import sys
import math

input = sys.stdin.readline
MOD = 1000000007

X = int(input())

sa = 100000
res = 0

if X == 1:
    print(1)
else:
    for i in range(2,X):
        a = int(math.log(X,i))
        if (sa > (X - (i**a))) & ( a != 1):
            sa = X - (i**a)
            res = i**a

    print(res)
import math

X = int(input())
ans = 0

for i in reversed(range(X)):
  num = int(math.sqrt(i))
  if num ** 2 == i and ans < i:
    ans = i

print(ans)
import math
X=int(input())
ans=0
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)
y = 0
x = int(input())
for i in range(1000**2+1):
    x2 = i**2
    if x2 <= x:
        y = x2
print(y)
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    l = [i*i for i in range(1,1100)]
    x = I()
    i = 0
    while l[i] <= x:
        i += 1
    print(l[i-1])
from collections import Counter
import sys

X = int(input())
num = []

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

for j in range(1, X):
    tmp = j + 1
    lis = []
    while tmp != 1:
        for i in range(2, tmp+1):
            if tmp % i == 0:
                lis.append(i)
                tmp = tmp // i
                break
    if len(Counter(lis)) == 1 and len(lis) != 1:
        num.append(j+1)

print(max(num))
x=int(input())
a=[]
for i in range(1,110):
  for j in range(2,100):
    if i**j<=x:
      a.append(i**j)
print(a[-1])
import math
X = int(input())
print(math.floor(X**0.5)**2)
x = int(input())
for i in range(1,100)[::-1]:
  if i*i <= x:
    print(i*i)
    exit()
from math import sqrt
X = int(input())

for x in reversed(range(1, X+1)):
  t = sqrt(x)
  if t.is_integer():
    print(x)
    break
pow = [1]
for p in range(2,32):
  i=1
  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)
# AtCoder Beginner Contest 097
# B - Exponential

X=int(input())
for i in range (X):
    a= (X-i)**0.5
    if a==int(a):
        print(int(a)**2)
        exit()
x=int(input())
b=[False for i in range(x)]
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**j<=x:
            b[i**j-1]=True
        else:
            break
for i in range(len(b),0,-1):
    if b[i-1]==True:
        print(i)
        exit()
X=int(input())
if X==1:
  max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        max=i**j
print(max)
x = int(input())
i = 1
while (i+1)**2 <= x:
    i += 1
print(i**2)
x = int(input())
import math

while True:
  if(str(math.sqrt(x))[-2] == "."):
    print(x)
    exit()
  else:
    x = x - 1
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*(i*j)>X:
                break
            sum=max(sum,i*(i*j))
    else:
        break
    ans=max(ans,sum)

print(sum)
x=int(input())

for i in range(x, 0, -1):
    for j in range(1, int(i**(1/2))+1):
        if i/j == j:
            print(i)
            exit()
x = int(input())
if x == 1:
    print(1)
else:
    print(int(max((x ** (1 / i) // 1) ** i for i in range(2, x + 1))))
t = set([])

for i in range(1,32):
    for s in range(2,32):
        if i**s<1001:
            t.add(i**s)
            
t = list(t)

t.sort(reverse = True)

x = int(input())

for i in range(len(t)-1):
    if t[i]>x>=t[i+1]:
        print(t[i+1])
        break
N=int(input())
for i in range(N,0,-1):
        if int(i**0.5)**2 == i:
            print(i)
            break
X = int(input())

li = []
for x in range(2,11):
  li += [ i**x for i in range(1,int(1000**(1/x)//1)+1)]
ans_list = sorted(list(set(li)), reverse=True)
print(ans_list)

for x in ans_list:
  if x <=X:
    print(x)
    break
X=int(input())
n=1
for b in range(2,X):
   p=2
   while(True):
      x=b**p
      print(x)
      if x<=X:
         n=x
         p+=1
      else:
         break
   
print(n)
x = int(input())
bekis = [1]
for i in range(2,35):
    for j in range(2,15):
        v = i**j
        if v > x: break
        bekis.append(v)

print(bekis[-1])
x = int(input())

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

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, max(2, j) + 1):
            if j ** k == i:
                l.append(i)
print(max(l))
n=int(input())
list=[]
for i in range(32):
	for j in range(10):
		ans=i**j
		if ans<=n:
			list.append(ans)
print(max(list))
import math
N = int(input())
print(math.floor(math.sqrt(N))**2)
from math import sqrt
X = int(input())

for x in reversed(range(1, X+1)):
  flag = False
  for i in range(2,12):
    t = x**(1/i)
    if t.is_integer():
      print(x)
      flag = True
      break
  if flag:
    break
x = int(input())
if x == 1:
  print("1")
  exit()
  
ans = 0
for b in range(2,x):
  for p in range(2,1000):
    tmp = pow(b,p)
    if tmp<=x:
      ans = max(ans,pow(b,p))
      break
      
print(ans)
from math import sqrt, log
x = int(input())
ans = 1
for i in range(2, int(sqrt(x)) + 1):
    n = int(pow(i, int(log(x, i))))
    if n <= x:
        ans = max(ans, n)
print(ans)
X = int(input())
ans = 0
for b in range(1,X):
    for p in range(2, X):
        if X >= b**p:
            if ans < b**p:
                ans = b**p
                break
print(ans)
from bisect import *
A = {1}
for p in range(2,11):
    for b in range(1,33):
        A.add(p**b)
A = list(A)
A.sort()
X = int(input())
print(A[bisect_right(A,X)-1])
a=int(input())
i=0
while i**2<=a:
  i=i+1
print((i-1)**2)
X=int(input())
import math
print(math.floor(math.pow(X,0.5))**2)
import math
n = int(input())
print(int(math.sqrt(n))**2)
from collections import Counter
import sys

X = int(input())
num = []

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

for j in range(1, X):
    tmp = j + 1
    lis = []
    while tmp != 1:
        for i in range(2, tmp+1):
            if tmp % i == 0:
                lis.append(i)
                tmp = tmp // i
                break
    if len(Counter(lis)) == 1 and len(lis) > 1:
        num.append(j+1)

print(max(num))
X=int(input())
l=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961]
for i in range(len(l)):
    if X<l[i]:
        print(l[i-1])
        exit()
print(l[-1])
X = int(input())

x = 0

for i in range(2,int(X ** 0.5) + 1):
  n = 1
  a = i
  while n < X :
    n *= a
  if n // a > x:
    x = (n // a)

print(x)
x = int(input())
num = [i**2 for i in range(1,33)]
def binary_search(li,k):
    left = 0
    right = 33
    while left < right:
        mid = (left+right)//2
        if li[mid]<=x and x<li[mid+1]:
            return li[mid]
        elif li[mid] < x:
            left = mid+1
        else:
            right = mid
print(binary_search(num,x))
from bisect import bisect_right
a = int(input())
dp = [1]
t = 1

while t**2<=10000:
    dp.append(t**2)
    t+=1
    if dp[-1]>=a:
        print(dp[-2])
        exit()
print(dp[bisect_right(dp,a)-1])
X = int(input())

if X < 4:
    print(1)
    exit()

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

print(ans)
i = int(input())
ans = 0
for ii in range(1,i):
	for p in range(2,i):
		if ii == (p*p):
			ans = ii
	
print(ans)
import math
a = int(input())
mx = 0

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

print(mx)
#ABC097
import math
x = int(input())
l = [1]
for i in range(int(math.sqrt(x))+1):
    j = 1
    for j in range(100):
        if i ** j > x:
            l.append(i ** (j-1))
            break
            
print(l[-1])
x = int(input())
import math

while True:
  if(math.sqrt(x).is_integer()):
    print(x)
    exit()
  else:
    x -= 1