peterverebics/CodeNet_Python_118 huggingface dataset:
a=int(input())
b=set()
ans=0
for i in range(1,a+1):
    for j in range(1,i+1):
        for k in range(2,a):
            if j**k==i:
                ans=i
print(ans)
X = int(input())
ans = 0

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

print(ans)
import math
X = int(input())
print((math.floor(math.sqrt(X)))**2)
from bisect import *
A = [x**2 for x in range(33)]
X = int(input())
print(A[bisect_right(A,X)-1])
x = int(input())

for i in range(34):
    if i ** 2 <= x < (i+1) ** 2:
        print(i ** 2)
x = int(input())

import math

for i in range(x,0,-1):
  if math.sqrt(i).is_integer():
    #print(math.sqrt(i))
    print(int(i))
    break
s = input()
x = int(s)

y = 2
max_ans = 1

for i in range(1, x):
    z = 1
    while y < x:
        z += 1
        y = z * z
        if y <= x:
            max_ans = max(max_ans, y)
    
print(max_ans)
x=int(input())
ans=1
for i in range(2,int(x**0.5)+1):
    while i*i<=x:
        i*=i
    ans=max(i,ans)
print(ans)
x = int(input())
ans = 0
for b in range(1, 1000):
  if x < b: break
  for p in range(2, 1000):
    if b**p <= x and ans < b**p:
      ans = b**p
    else:
      break
print(ans)
import math
X = int(input())
print(int(math.sqrt(X))**2)
import bisect
X = int(input())

cand = [1]
for x in range(2, 34):
    while x <= 1000:
        x *= x
        cand.append(x)

cand = list(set(cand))
cand.sort()
i = bisect.bisect_right(cand, X)
print(cand[i-1])
X=int(input())
ans=1
for i in range(1,X):
    for j in range(40):
        for k in range(40):
            if i==j**k:
                ans=j**k
print(ans)
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)

N = int(input())

for i in range(len(p) - 1):
  if p[i] <= N < p[i + 1]:
    print(p[i])
x = int(input())
 
pre = 0
arr = []
for b in range(331,):
    print(b)
    for p in range(2,33):
        if b ** p <= x:
            arr.append(b**p)
 
print(max(arr))
X = int(input())
nums = set([1])
for i in range(2, int(1000 ** .5) +1):
    b = 2
    while True:
        temp = i ** b
        if temp > 1000:
            break
        nums.add(temp)
        b += 1
sorted_nums = sorted(list(nums), reverse=True)
# print(f"nums:{sorted_nums}", file=sys.stderr)
for i in range(len(sorted_nums) - 1):
    if sorted_nums[i] > X >= sorted_nums[i + 1]:
        print(sorted_nums[i + 1])
X = int(input())
list = []

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

elif X == 2:
  list.append(2)
  
else:
  for b in range(2, X):
    p = 2
    while b ** p < X:
      list.append(b ** p)
      p += 1
      
print(max(list))
x = int(input())

for i in range(x,0,-1):
  if (i**(1/2)).is_integer() or (i**(1/3)).is_integer():
    print(i)
    break
from math import sqrt, log
x = int(input())
ans = 1
for i in range(2, x):
    n = int(pow(i, max(2, int(log(x, i)))))
    if n <= x:
        ans = max(ans, n)
print(ans)
X = int(input())
for i in range(1000):
  if i**2 == X:
    print(i**2)
    break
  elif i**2 > X:
    print((i-1)**2)
    break
n = int(input())
ans = 0
for i in range(2, int(n**0.5+1)):
  tmp = i
  while tmp <= n//i:
    tmp *= i
  ans = max(ans, tmp)
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(N):
        for p in range(N):
            if b ** p <= N:
                ret = b ** p

    print(ret)


if __name__ == '__main__':
    main()
n = int(input())
p = int(int(n**0.5)**2)
print(p)
import math
X=int(input())
max_num = 0
for i in range(2,10):
  tei = math.floor(X**(1/i))
  if max_num < tei**i:
    max_num = tei**i
print(max_num)
import math
def main():
    X = int(input())
    ma = 1
    for i in range(1, X+1):
        for j in range(2, 33):
            p = math.log(i, j)
            if p.is_integer() == True and p >= 2:
                if ma < j**p:
                    ma = j**p
    print(int(ma))
main()
X = int(input())

import math

while not float.is_integer(math.sqrt(X)):
  X -= 1

print(X)
x=int(input())
for i in range(x+1):
  ima=x-i
  for j in range(ima+1):
    if j*j==ima:
      print(ima)
      exit()
X=int(input())
ans=0
for b in range(1,33):
	for p in range(2,11):
		if b**p<=X:
			ans=b**p
print(ans)
X = int(input())

max_ans = 0
for i in range(1, X+1):
    for j in range(2, X+1):
        if i ** j >= X:
            break
        max_ans = max(max_ans, i**j)
print(max(1, max_ans))
def solve():
    X = int(input())
    ans = 0
    for i in range(2,32):
        for j in range(2,11):
            x = pow(i,j)
            if X < x:
                break
            if ans < x:
                ans = x

    print(ans)
if __name__ == '__main__':
    solve()
x = int(input())
X = int(x**0.5)
print((X+1)**2 if (X+1)**2 <= x else X**2)
x=int(input())
ans=0
for i in range(1,x):
  for j in range(2,12):
    if i**j<=x:
      ans=max(ans,i**j)
    else:
      break
print(ans)
x = int(input())

import math
ans = []
for i in range(0,x):
  if math.sqrt(i).is_integer():
    ans.append(i)
print(max(ans))
x = int(input())

a = []

for i in range(x):
    if i**2 <= x:
        b=i*i
        a.append(b)

print(1 if x == 0 else max(max(a),1))
x = int(input())
ans = 0
for a in range(1,x):
  for b in range(1,1000):
    if a**b <= x:
      ans = max(ans,a**b)
print(ans)
x = int(input())
l = [1]
for i in range(2,31):
    num = i
    num *= num
    while num < x:
        l.append(num)
        num *= num
print(max(l))
X = int(input())
for i in range(1, 1000):
    tmp = i * i
    if tmp > X:
        print((i - 1) * (i - 1))
        break
a=int(input())
d=0
for i in range(33):
  b=i+2
  while b<a:
    b=b*(i+2)
  c=b/(i+2)
  if d<=c:
    d=c
print(int(d))
import math

X = int(input())
ans = 0

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

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

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

print(ans)
x = int(input())
a = 0
for i in range(x):
  for j in range(x):
    if i**j < x and x < i**(j+1):
      a = max(a,i**j)
print(a)
x=int(input())
data=[1,2,3,5,7,11,13,17,19,23,29,31]
ans=0
for i in data:
  for j in range(2,10):
    if i**j<=x:
      ans=max(ans,i**j)
print(ans)
x = int(input())
li = []
for i in range(100):
    n = i+1
    while x >= n**2:
        li.append(n**2)
        n += 1
print(max(li))
X = int(input())

ans = -1
for p in range(1, 1000+1):
    for b in range(2, 10):
        t = b**p
        if t <= X:
            if ans < t:
                ans = t
        else:
            break

print(ans)
import math 
X=int(input())
max_num=0
for i in range(2,10):
  tei=math.floor(X**(1/i))
  if max_num<=tei**i:
    max_num=tei**i
print(max_num)
X = int(input())
ans = 1
while (ans + 1) ** 2 <= X:
    ans += 1
print(ans * ans)
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,5):
        li.append(i**j)
li.sort()
ans = 1
for k in range(len(li)):
    if (li[k]>N)&(li[k-1]<N):
        ans = li[k-1]
print(ans)
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

x = readInt()
l = [0]*(x+1)
l[1]=1

for i in range(2,len(l)):
  if i*i>len(l)-1:
    break
  else:
    l[i]=1
    l[i*i]=1

for i in range(len(l)-1,-1,-1):
  if l[i]==1:
    print(i)
    break
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

X = int(readline())

ans = 1
while ans * ans <= X:
    ans += 1
print((ans - 1)**2)
x=int(input())
if x==1000:
  print(1000)
l=[1]
for i in range(2,32):
  k=2
  while i**k<=1000:
    l.append(i**k)
    k+=1
l=sorted(l)
for i in range(len(l)-1):
  if l[i]<=x<l[i+1]:
    print(l[i])
    exit()
print(961)
i = int(input())
ans = 0
for ii in range(i+1):
	if (ii ** .5).is_integer():
		ans = ii
print(ans)
import math 
X=int(input())
max_num=0
for i in range(2,11):
  tei=math.floor(int(X**(1/i)))
  if max_num<tei**i:
    max_num=tei**i
print(max_num)
X=int(input())
i=2
beki=[]

while i<=X:
    j=2  
    while i**j<X:
        beki.append(i**j)
        j+=1
    i+=1
if len(beki)==0:
    print(1)
else:
    print(max(beki))
import math
x = int(input())
ans = 0
mx = 0
for b in range(1, int(math.sqrt(x))+1) :
    if b == 1 :
        mx = 1
        continue
    p = 1
    while b ** p < x :
        mx = max(b**p, mx)
        p += 1
print(mx)
X=int(input())
for i in range(1, X):
  for j in range(2, X):
    if i**j<=X:
      max=i**j
print(max)
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
for i in range(X):
    for j in range(X):
        M = i**j
        if M > X:
            if j == 2:
                break
            S.append(i**(j-1))
            break
        elif M == X:
            exit()   
print(max(S))
x = int(input())
for i in range(x+1):
    if i**2 <= x:
        count = i**2
print(count)
import math
def main():
    N = int(input())
    print(math.floor(math.sqrt(N))**2)
main()
import math
X = int(input())

output = 1
for i in range(2,X):
    for j in range(2, X):
        if i ** j < X:
            output = i ** j
            break
            
print(output)
from bisect import *
A = [x**2 for x in range(33)]
X = int(input())
print(A[bisect_left(A,X)-1])
X=int(input())
if X==1 or 2:
  max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        max=i**j
print(max)
# solution
import io

nim = int(input())
mike = 1
for i in range(2,(nim+1)//2):
  kite = 0
  counter = 0
  while kite <= nim:
    m = max(mike,kite)
    kite = i**counter
    counter+=1
print(mike)
X=int(input())
res=0
for b in range(1,X+1):
  for p in range(2,X+1):
    if b**p<=X :
      res=max(res,b**p)
    else:
      break
print(res)
X = int(input())

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

print(ans)
x = int(input())
vis = [False for _ in range(1001)]
vis[0] = True
vis[1] = True
for i in range(2,1001):
  tmp = i
  while (tmp < 1001):
    vis[tmp] = True
    tmp *= i
best = 0
for i in range(x+1):
  if vis[i] and i > best:
    best = i
print(i)
x = int(input())
print(int(x**(1/2))**2)
def main():
    X = int(input())
    ma = 0
    for b in range(1, X+1):
        for p in range(2, X+1):
            if b**p > X:
                break
            ma = max(ma, b**p)
    print(ma)


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

ans = 1
for Y in range(X,1,-1):
    for b in range(Y,2,-1):
        p = math.log(Y,b)
        if p % 1 ==0 and p > 1:
            ans = max(ans, b ** p)
print(int(ans))
from math import sqrt, log
x = int(input())
ans = 1
for i in range(2, int(sqrt(x)) + 1):
    ans = int(pow(i, int(log(x, i))))
print(ans)
x=int(input())
ans=0
for i in range(2,x):
  for j in range(1,12):
    if i**j<=x:
      ans=max(ans,i**j)
    else:
      break
print(ans)
import sys
X = int(input())
L = []
for i in range(1,32):
  for j in range(1,10):
    if X < i**j:
      if j != 2:
        L.append(i**(j-1))
        break
      break
    elif X == i**j:
      print(i**j)
      sys.exit(0) #平方数忘れ
print(max(L))
X = int(input())
n = 1
while n ** 2 <= X:
  n += 1

if n ** 2 == X:
  print(X)
else:
  print((n-1) ** 2)
import math

X = int(input())
ans = 0

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

print(ans)
import math
n=int(input())
ans = 1
for i in range(int(math.sqrt(n))+1):
  for j in range(int(math.sqrt(n))+1):
    if i**j < n and ans < i ** j:
      ans = i**j
print(ans)
X = int(input())
ans = 1
for i in range(X):
    N, n = X - i, X - i
    b = 0
    for j in range(2, n):
        if b == 0:
            while N % j == 0:
                N //= j
                b = 1
        else:
            break
    if b == 1 and N == 1:
        ans = n
        break
print(ans)
from bisect import bisect_right
a = int(input())
dp = [1]
t = 1

while t**2<=1000:
    dp.append(t**2)
    t+=1

print(dp[bisect_right(dp,a)-1])
import math

x = int(input())
print(int(math.sqrt(x)) ** 2)
import math
X = int(input())
print(math.floor(X**(1/2))**2)
x = int(input())
i = 1
while (i+1)**2 < x:
    i += 1
print(i**2)
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)
X = int(input())
while(1):
    for i in range(2,11):
        f = pow(X,1.0/float(i))
        if(f.is_integer()):
            print(X)
            exit()
    X-=1
x = int(input())
print(max(i ** j for i in range(1, 34) for j in range(1, 11) if i ** j <= x))
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 b in range(1,101):
    for p in range(2,10):
        if X >= b**p:
            ans = b**p
print(ans)
x = int(input())
l = [1]
for i in range(2,32):
    num = i
    num *= num
    while num < x:
        l.append(num)
        num *= num
print(max(l))
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)

print(sorted(lst))

for k in range(X):
    if X - k in lst:
        print(X-k)
        break
import sys

def resolve():
    X = int(input())
    cands = [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]
    for i in range(len(cands)):
        if cands[i] > X:
            print(cands[i-1])
            return

if '__main__' == __name__:
    resolve()
x = int(input())
ans = 1

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

b = 1
p = 2

a = [b ** p]

i = 0
j = 0
while (b+i) ** (p+j) <= x:
    while True:
        if (b+i) ** p <= x:
            a.append((b+i) ** (p+j))
        else:
            break
        i += 1
    j += 1

print(max(a))
x = int(input())

a = []

for i in range(x):
    if i**2 <= x:
        b=i*i
        a.append(b)

print(0 if x == 0 else max(max(a),1))
X=int(input())
max=1
for i in range(1, X):
  for j in range(2, X):
    if i**j<=X:
      if i**j>max:
        max=i**j
      else:
        break
print(max)
a=int(input())
d=0
for i in range(40):
  b=i+2
  while b<a:
    b=b*(i+2)
  c=b/(i+2)
  if d<=c:
    d=c
print(int(d))
from math import *

x = int(input())

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

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

print(lst2[-1])
k=int(input())
ans=1
while ans**2<k:
    ans+=1
print(1 if k==1 else (ans-1)**2)
x = int(input())

b = 1
p = 2

a = []

i = 0
j = 0
while (b+i) ** (p+j) <= x:
    i = 0
    while (b+i) ** p <= x:
            a.append((b+i) ** (p+j))
            i += 1
    j += 1

print(max(a))
import math


x = int(input())

ans = 0
for i in range(x, -1, -1):
    tmp = math.sqrt(i)
    if math.sqrt(i).is_integer():
        print(i)
        exit()
X = int(input())
fact = [1]
for i in range(2, 40):
  p = i
  while(p <= 1000):
    fact.append(p)
    p = p*i
fact.sort()
ans = 0
for n in fact:
  if(n <= X):
    ans = n
  else:
    break
print(ans)
X = int(input())

ans = 0
for i in range(1, 32, 1):
    if i*i<=X:
        ans = i
print(ans*ans)
ls = [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())
for i in range(len(ls)):
  if X<=ls[i]:
    print(ls[i])
    break
x = int(input())
for i in reversed(range(x + 1)):
    if (i ** 0.5).is_integer():
        print(i)
        break
import sys
import math
x = int(input())
li = [1]
for i in range(2,40):
    tmp = 1
    while (i ** tmp <= 1000):
        li.append(i ** tmp)
        tmp += 1
for i in range(x, 0, -1):
    if (i in li):
        print(i)
        sys.exit()
from math import floor, log

x = int(input())

ans = 1
for i in range(2, floor(x ** 0.5) + 1):
    temp = i ** floor(log(x, i))
    if temp > ans:
        ans = temp
print(ans)
import math
X = int(input())
b = 1
for i in range(100,1,-1):
    a = math.floor(math.log(X, i))
    b = max(i**a,b)
print(b)
#B - Exponential
X = int(input())
for i in range(X,0,-1):
    X_1 = i**0.5
    if X_1.is_integer():
        print(i)
        exit()
    else:
        pass
N = int(input())
ans = 0
for i in range(1, N):
    for j in range(1, 20):
        if i ** j > N:
            break
        ans = max(i ** j, ans)
print(ans)
x=int(input())
ans=1
while (ans+1)**2<=x:
    ans+=1
print(ans**2)
x = int(input())
ans = 0
for i in range(1,x):
    for j in range(2,50):
        if i**j<=x:
            ans = max(ans,i**j)
        else:
            break
    if i**2>x:
        break
print(ans)
X=int(input())
p=[]
p.append(1)
for i in range(2,1000):
  for j in range(1,10):
    p.append(pow(i,j))
p.sort()
ans=0
for i in range(len(p)):
  if p[i]>X:
    break
  ans=p[i]
print(ans)
x = int(input())

for i in range(x, 0, -1):
    if int(i**(1/2))**2==i:
        print(i)
        break
x = int(input())
ans = 0
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**(1/j) % 1 == 0:
            ans = i
print(ans)
x = int(input())
r = []
for i in range(1,999):
    if i*i >= 1000:
        break
    r.append(i*i)
r.reverse()
for y in r:
    if x >= y:
        print(y)
        break
x = int(input())

for i in range(x):
    for j in range(2, 31):
        if (x-i)**(1/j) % 1 == 0:
            print(x-i)
            exit()
x = int(input())
c = 1
while c:
    for i in range(2, 10):
        y = x ** (1 / i)
        if y % 1 == 0:
            print(x)
            c = 0
            break
    x -= 1
import itertools
import sys
input = sys.stdin.readline

X = int(input())
ans = 0
for i in itertools.count(2):
    b = int(X**(1/i))
    ans = max(ans, b**i)
    if b == 1:
        break
print(ans)
import math
X=int(input())
a=math.sqrt(X)
b=int(a)
ans=1
for i in range (2,b+1):
    for j in range(2,10):
        if b**j <=X <b**(j+1):
            ans=max(ans,b**j)
            break

print(ans)
import math

x = int(input())
print(int(math.sqrt(x))**2)
# from sys import stdin
import math

X = int(input())

# for i in range(33):
ans = 0
for i in range(int(math.sqrt(X))+1):
    for x in range(11):
        
        if i**x < X and i**x > ans:
            ans = i**x
print(ans)
X=int(input())
for i in range(1,33):
    if (i)**2 > X:
        print((i-1)**2)
        break
X = int(input())
Max = 0
for i in range(2,3):
    b = int(X**(1/i))
    B = (b)**i
    if Max < B:
        Max = B
print(Max)
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

x = ni()

num = 1

for i in range(100):
  for j in range(10):
    if i**j <= x:
      num = i**j

print(num)
X = int(input())
print(int(X**0.5-1)**2)
X = int(input())



while 1:
  if X**0.5 == int(X**0.5):
    print(X)
    break
  X -= 1
X = int(input())
while(1):
    for i in range(2,10):
        if(pow(X,1.0/float(i))%1.0==0.0):
            print(X)
            exit()
    X-=1
a = int(input())

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

res = 0
import math

for i in range(2,32):
    x = int(math.log(a,i))
    if x ==1:
        pass
    else:
        j = i**x
        res = max(res,j)
    
print(res)
import math
k=int(input())
print(int(math.sqrt(k))**2)
X=int(input())
i=2
beki=[]

while i<=X:
    j=2  
    while i**j<X:
        beki.append(i**j)
        j+=1
    i+=1
if len(beki)==0:
    print(X)
else:
    print(max(beki))
n = int(input())
for i in range(1, 11):
  if i**2 > n:
    print((i-1)**2)
    break
import math
a = int(input())
print(int(math.pow(a,1/3)) ** 3)
import math

X = int(input())
if X < 4:
    print(1)
    exit()
for x in range(X, 0, -1):
    print("x:", x)
    for y in range(2, x, 1):
        print("y:", y)
        log = math.log(x, y)
        print("log:", log)
        div, mod = divmod(log, 1)
        if mod == 0:
            print(x)
            exit()
X = int(input())
count = [1]
for x in range (1,50):
    for y in range (1,10):
        if x ** y <= X:
            count.append(x ** y)
print(max(count))
import math
X = int(input())
b = int(math.sqrt(X))

print(b**2)
import math
X = int(input())

ans = 1
for Y in range(X,1,-1):
    for b in range(Y,1,-1):
        p = math.log(Y,b)
        if p % 1 ==0 and p > 1:
            ans = max(ans, b ** p)
print(int(ans))
x = int(input())
 
ans=1
for i in range(1,x):
    for j in range(2,x):
        if i**j<=x:
            ans=i**j
        else:
            break
print(ans)
X = int(input())
so = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
a = 0
for i in so:
    if i ** 2 <= X:
        a += 1

b = []
x = 1
for i in range(a):
    y = so[i]
    while y <= X:
        y *= so[i]
        
    

    y = y // so[i]
    b.append(y)

b = sorted(b, reverse = True)

if len(b) == 0:
    print(1)
else:
    print(b[0])
from math import log,floor
X = int(input())
if X < 4:
  print(1)
else:
  answer = 0
  for b in range(2,X):
    answer = max(answer,int(b**floor(log(X,b))))
  print(answer)
n = int(input())
A = []
for i in range(40):
    for j in range(20):
        A.append(i**j)

A = sorted(A)
ans = 0
for i in A:
    if i <= n:
        ans = i
    else:
        break
print(ans)
import math
x = int(input())
if x == 1:
    print(1)
    exit()

ans = 2
n = math.ceil(math.sqrt(x))
for a in range(n,1,-1):
    if a*a <= x:
        ans = a*a
        break
print(ans)
import math
X=int(input())
a=math.sqrt(X)
b=int(a)
ans=1
for i in range (2,b+1):
    for j in range(1,10):
        if b**j <=X <b**(j+1):
            ans=max(ans,b**j)
            break

print(ans)
x=int(input())
res=0
for b in range(x):
    for p in range(2,x):
        if res<(b**p)<=x:
            res=b**p
        elif b**p>x:
            break
print(res)
import sys
input = sys.stdin.readline
X = int(input())
ans = [1]
for i in range(2, 1 + int(X ** (1/2))):
    ans.append(i)
    while i < X:
        i *= i
        if i <= X:
            ans.append(i)
print(max(ans))
n = int(input())
l = []
l.append(1)
for i in range(2,40):
  b = i**2
  while b <= 1000:
    l.append(b)
    b*= i
l.sort()

for i in range(len(l)):
  if n < l[i]:
    print(l[i-1])
    exit()
x = int(input())

ans = 0
for b in range(1, 1001):
    for p in range(2, 1001):
        if b ** p > x:
            break
        ans = b ** p
        
print(ans)
x = int(input())
tmp = int(x**0.5)+2
ans = 1

for i in range(1,tmp):
    for j in range(2,tmp):
        if x >= i**j:
            ans = i**j
print(ans)
n = int(input())
for i in range(11):
  if i**2 > n:
    print((i-1)**2)
    break
x = int(input())
i = 1
while i**2<=x:
    i+=1
print((i-1)**2)
X = int(input())
so = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
a = 0
for i in so:
    if i ** 2 <= X:
        a += 1

b = []
x = 1
for i in range(a):
    y = so[i]
    while y <= X:
        y *= so[i]
        
    

    y = y // so[i]
    b.append(y)

b = sorted(b, reverse = True)

if len(b) == 0:
    print(1)
else:
    print(b[0])
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 / p


z = []
a = 2

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

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