CodeEff/ECCO huggingface dataset:
# Original solution
N, P = list(map(int, input().split()))
ans = 1
 
if N >= 45:
  print(ans)
elif N == 1:
  print(P)
  
 
  
else:
  i = 1
  while(i**N <= P):
    if P % (i**N) == 0:
      ans = i
    i += 1
  print(ans)

# Optimized solution
n,p=list(map(int,input().split()))
 
if n==1:
    print(p)
elif n>45:
        print((1))

else:
    x=round((p**(1/n)+1))+1
    for i in range(x,0,-1):        
                if p%(i**n)==0:
                    print(i)
                    break
# Original solution
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = list(map(int, input().split()))

limit = int(pow(P,1/N)//1+1)

if N == 1:
    ans = P
else:
    ans = 1
    for i in range(2,limit+1):
        if P % pow(i,N) == 0:
            ans = i

print(ans)


# Optimized solution
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = list(map(int, input().split()))

limit = int(pow(P,1/N)//1)

if N == 1:
    ans = P
elif limit == 1:
    ans = 1
else:
    ans = 1
    for i in range(2,limit+2):
        if P % pow(i,N) == 0:
            ans = i
            
print(ans)
# Original solution
import math
 
n,p=list(map(int,input().split()))
 
def C(N,P):
    if N == 1: return P
    
    a=math.ceil((P**(1/N)))+2
 
    res=1
    for i in range(2,a):
        if P % i**N == 0 : res = i
 
    return res
 
print((C(n,p)))

# Optimized solution
n,p = list(map(int,input().split())) 
i = a = o = 1
m = round(p**(1/n))
for i in range(m,0,-1):
    a = i**n
    if p%a==0:
        print(i)
        exit()
# Original solution
n,p=list(map(int,input().split()))

i=1
gcd=1
if(n==1):
    print(p)
else:
    while((i**n)<=p):
        if(p%(i**n)==0):
            gcd=i
        i+=1
        
    print(gcd)

# Optimized solution
n,p=list(map(int,input().split()))

i=2
gcd=1
if(n>40):
    print((1))
elif(n==1):
    print(p)
else:
    while((i**n)<=p):
        if(p%(i**n)==0):
            #print(i)
            gcd*=i
            p/=(i**n)
            i-=1
        i+=1
        
    print(gcd)
# Original solution
from math import floor
n, p = list(map(int, input().split()))
if n == 1:
    print(p)
else:
    for i in range(1, floor(p**(1/n))+2):
        if p % i**n ==0:
            res = i
    print(res)


# Optimized solution
n, p = list(map(int, input().split()))
if n == 1:
    print(p)
else:
    for i in range(1, round(p**(1/n))+1):
        if p % i**n ==0:
            res = i
    print(res)
# Original solution
N, P = list(map(int, input().split()))
if N == 1:
    print(P)
    exit()
elif P == 1:
    print("1")
    exit()

ans = 1
tmp = P

for i in range(2, P):
    po = pow(i, N)
    while tmp % po == 0:
        tmp = tmp // po
        ans = ans * i
        # print(i, tmp, ans)

    if tmp < po:
        break

print(ans)


# Optimized solution
N, P = list(map(int, input().split()))
if N == 1:
    print(P)
    exit()
elif P == 1:
    print("1")
    exit()

ans = 1
tmp = P

for i in range(2, int(pow(P, 1 / N)) + 1):
    po = pow(i, N)
    while tmp % po == 0:
        tmp = tmp // po
        ans = ans * i
        # print(i, tmp, ans)

    if tmp < po:
        break

print(ans)
# Original solution
n, p = list(map(int, input().split()))
if n == 1 or p== 1:
    print(p)
    exit()
c2 = 0
while p%2 == 0:
    c2 += 1
    p//=2
c = 2**(c2//n)
i = int(p**(1/n))+1
while i > 1:
    if p%(i**n) == 0:
        print((c*i))
        exit()
    else:
        i -= 1
print(c)

# Optimized solution
n, p = list(map(int, input().split()))
if n == 1 or p== 1:
    print(p)
    exit()
c2 = 0
while p%2 == 0:
    c2 += 1
    p//=2
c = 2**(c2//n)
i = int(p**(1/n))+1
if i%2 == 0:
    i -= 1
while i > 1:
    if p%(i**n) == 0:
        print((c*i))
        exit()
    else:
        i -= 2
print(c)
# Original solution
import math
N, P = list(map(int, input().split()))
ProotN = pow(P, 1/N)
# print(ProotN)
for i in range(math.ceil(ProotN), 0, -1):
    if (P/i**N).is_integer():
        print(i)
        break

# Optimized solution
def prime_decomposition(n):
    i = 2
    dic = {}
    while i * i <= n:
        while n % i == 0:
            n /= i
            if i in dic:
                dic[i] += 1
            else:
                dic[i] = 1
        i += 1
    if n > 1:
        dic[int(n)] = 1
    return dic

N, P = list(map(int, input().split()))
d = prime_decomposition(P)
ret = 1
for k, v in list(d.items()):
    if v >= N:
        ret *= k ** (v//N)
print(ret)
# Original solution
# -*- coding: utf-8 -*-


def main():
    from math import sqrt

    n, p = list(map(int, input().split()))
    ans = 1
    numbers = set()

    for i in range(1, int(sqrt(p)) + 1):
        a, b = divmod(p, i)

        if b == 0:
            numbers.add(i)
            numbers.add(a)

    for number in numbers:
        c, d = divmod(p, number ** n)

        if d == 0 and number ** n <= p:
            ans = max(ans, number)

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
# -*- coding: utf-8 -*-


def run_prime_factorization(max_number: int):
    from math import sqrt

    ans = dict()
    remain = max_number

    for j in range(2, int(sqrt(max_number)) + 1):
        if remain % j == 0:
            count = 0

            while remain % j == 0:
                count += 1
                remain //= j

            ans[j] = count

    if remain != 1:
        ans[remain] = 1

    return ans


def main():
    n, p = list(map(int, input().split()))
    ans = 1

    # See:
    # https://www.youtube.com/watch?v=z0bIhkaSXY4
    results = run_prime_factorization(p)

    for base, exponent in list(results.items()):
        ans *= base ** (exponent // n)

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import math


def read():
    N, P = list(map(int, input().strip().split()))
    return N, P


def solve(N, P):
    v3 = math.floor(P**(1/N)) + 1
    for v in range(v3, 0, -1):
        if P % (v**N) == 0:
            return v
    return 1


if __name__ == '__main__':
    inputs = read()
    print((solve(*inputs)))


# Optimized solution
import math


def read():
    N, P = list(map(int, input().strip().split()))
    return N, P


def solve(N, P):
    # problem constraint
    if N >= 40:
        return 1
    # solve
    v3 = math.floor(P**(1/N)) + 1
    for v in range(v3, 0, -1):
        if P % (v**N) == 0:
            return v
    return 1


if __name__ == '__main__':
    inputs = read()
    print((solve(*inputs)))
# Original solution
n, p = list(map(int, input().split()))
out=1
tm = int(pow(p, 1/n))
for i in range(2,tm+1):
    if i==2:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
    elif i==3:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
    elif i%2!=0 and i%3!=0:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
print(out)

# Optimized solution
n, p = list(map(int, input().split()))

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)
# Original solution
import functools
import operator

N,P = list(map(int,input().split()))

i = 2
res = []
if N == 1:
  print(P)
elif P == 1:
  print((1))
else:
  while i <= P**1/N:
    while P % i**N == 0:
      P /= i**N
      res.append(i)
    else:
      if i == 2:
        i += 1
      else:
        i += 2
  res.append(1)
  result = functools.reduce(operator.mul, res)
  print(result)
  exit()

# Optimized solution
N,P = list(map(int,input().split()))
i = round(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print((1))
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)
      break
# Original solution
n,p = list(map(int,input().split()))
if n == 1:
    print(p)
    exit()
if n >=40:
    print((1))
    exit()
i =2
ans =1
while i**n <= p:
    if p%(i**n)==0:
        ans *= i
        p =p//(i**n)
 
    else:
        i += 1
print(ans)

# Optimized solution
n,p = list(map(int,input().split()))
if n == 1:
    print(p)
    exit()
if n >=40 or p==1:
    print((1))
    exit()
i =2
ans =1
while i**n <= p:
    if p%(i**n)==0:
        ans *= i
        p =p//(i**n)
 
    elif i==2:
      i+=1
    else:
      i+=2
print(ans)
# Original solution
n,p = list(map(int,input().split()))
if n == 1:
    print(p)
    exit()
if n >=40 or p==1:
    print((1))
    exit()
i =2
ans =1
while i**n <= p:
    if p%(i**n)==0:
        ans *= i
        p =p//(i**n)
 
    elif i==2:
      i+=1
    else:
      i+=2
print(ans)

# Optimized solution
N,P = list(map(int,input().split()))
ans=1
i=2
if N==1:
  print(P)
  exit()
if N>=40 or P==1:
  print((1))
  exit()
  
while i**N<=P:
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)
# Original solution
from collections import Counter


def d(P):
    c = Counter()
    i = 2
    while (P > 1):
        if P % i == 0:
            c.update([i])
            P //= i
            i -= 1
        i += 1
    return c


def solve(N, P):
    c = d(P)
    ans = 1
    for k in [k for k, v in list(c.items()) if v >= N]:
        ans *= k ** (c[k] // N)
    return ans


if __name__ == "__main__":
    N, X = tuple(map(int, input().split(" ")))
    print((solve(N, X)))


# Optimized solution
from collections import Counter


def d(P):
    c = Counter()
    i = 2
    while (P > 1):
        if P % i == 0:
            c.update([i])
            P //= i
            i -= 1
        i += 1
        if i > P ** 0.5:
            c.update([P])
            break
    return c


def solve(N, P):
    c = d(P)
    ans = 1
    for k in [k for k, v in list(c.items()) if v >= N]:
        ans *= k ** (c[k] // N)
    return ans

if __name__ == "__main__":
    N, X = tuple(map(int, input().split(" ")))
    print((solve(N, X)))
# Original solution
n,p=list(map(int,input().split()))

if n==1:
  print(p)
else:
  ans=1
  for i in range(1,int(p**(1/n))+2):
    tmp=i**n
    if (p>=tmp) and (p%tmp == 0):
     ans=i
    if(p<tmp):
      break
  print(ans)


# Optimized solution
n,p=list(map(int,input().split()))

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

kekka=factorize(p)

ans=1
for i in range(len(kekka)):
    ans=ans* kekka[i][0] ** (kekka[i][1]//n)
print(ans)
# Original solution
n,p = list(map(int,input().split()))

ans = 1
x = int(p ** (1/n)) +1

while x > 1:
    y = x ** n
    if p % y == 0:
        p //= y
        ans *= x
    else:
        x -= 1

print(ans)

# Optimized solution
n,p = list(map(int,input().split()))

ans = 1
x = int(p ** (1/n))

while x > 1:
    y = x ** n
    if p % y == 0:
        p //= y
        ans *= x
        if p == 1:
            break
    else:
        x -= 1

print(ans)
# Original solution
N,P = list(map(int,input().split()))
c = int(P**(1/N))+1
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if N>1 and is_prime(P):
    print((1))
    exit()
while(1):
    if P%(c**N)==0:
        print(c)
        exit()
    c-=1

# Optimized solution
N,P = list(map(int,input().split()))
r = round(P**(1/N))
for i in range(r,0,-1):
    if P%(i**N)==0:
        print(i)
        exit()
# Original solution
N, P = list(map(int, input().split()))
import math
g = 1
if N ==1:
    print(P)
else:
    for i in range(1,math.ceil(P**(1/N))+1):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                g = i
    print(g)

# Optimized solution
N, P = list(map(int, input().split()))
import math
g = 1
if N ==1:
    print(P)
else:
    for i in range(1,int((P+1)**(1/N))+1):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                g = i
    print(g)
# Original solution
import math

n,p = list(map(int,input().split()))

tmp = math.sqrt(p)

if n == 1:
    print(p)
else:
    for i in range(1,int(tmp)+1):
        if p % (i ** n) == 0:
            ans = i
    print(ans)

# Optimized solution
import math

n,p = list(map(int,input().split()))

tmp = math.sqrt(p)

if n == 1:
    print(p)
elif n >=100:
    print((1))
else:
    for i in range(1,int(tmp)+1):
        if p % (i ** n) == 0:
            ans = i
    print(ans)
# Original solution
import math
n, p=list(map(int,input().split()))
ans = 0
if n != 1:
    for i in range(1,int(math.sqrt(p+1))+1):
        ni = i**n
        if p/ni >= 1 and p/ni == int(p/ni):
            ans = i
        elif p/ni < 1:
            break
    print(ans)
else:
    print(p)

# Optimized solution
n, p=list(map(int,input().split()))
ans = 0
if n != 1:
    for i in range(1,int((p+1)**(1/n))+1):
        ni = i**n
        if p/ni >= 1 and p/ni == int(p/ni):
            ans = i
        elif p/ni < 1:
            break
    print(ans)
else:
    print(p)
# Original solution
import math
if __name__ == "__main__":
    n, p = list(map(int, input().split()))
    res = 1
    sup = math.ceil(p ** (1 / n))
    i = 2
    while(i <= sup and i <= p):
        if p % i == 0:
            k = 1
            p /= i
            while(p % i == 0):
                p /= i
                k += 1
            if k >= n:
                for s in range(k // n):
                    res *= i
        i += 1
    print(res)

# Optimized solution
import math
if __name__ == "__main__":
    n, p = list(map(int, input().split()))
    if n == 1:
        print(p)
    else:
        res = 1
        sup = math.ceil(p ** (1 / n))
        i = 2
        while(i <= sup and i <= p):
            if p % i == 0:
                k = 1
                p /= i
                while(p % i == 0):
                    p /= i
                    k += 1
                if k >= n:
                    for s in range(k // n):
                        res *= i
            i += 1
        print(res)
# Original solution
N, P = list(map(int, input().split()))
ans = 0
if N == 1:
    print(P)
else:
    for i in range(1, int(P**(1/N)+5)):
        if P % i**N == 0:
            ans = i
    print(ans)


# Optimized solution
N, P = list(map(int, input().split()))
ans = 0
if N == 1:
    print(P)
elif N >= P or N > 50:
    print((1))

else:
    for i in range(1, int(P**(1/N)+2)):
        if P % i**N == 0:
            ans = i
    print(ans)
# Original solution
N, P = list(map(int, input().split()))

from math import sqrt
from collections import Counter

def is_prime(n):
    if n == 1: return False
    if n == 2: return True
    for i in range(2, int(sqrt(n))+1):
        if n % i == 0: return False
    return True

def prime_factorization(n):
    #if is_prime(n):return [n]
    factor = []
    f = 2
    while n > 1:
        if n % f == 0:
            factor.append(f)
            n /= f
        else:
            f += 1
    return factor

p = prime_factorization(P)
c = Counter(p)

l = []
j = []
for k, v in list(c.items()):
    if N <= v:
        l.append(k)
        j.append(v//N)
ans = 1
for i,v in zip(l,j):
    ans *= i**v

print(ans)

# Optimized solution
from collections import Counter

N, P = list(map(int, input().split()))

def prime_factorization(n):
    factor = []
    f = 2
    while f ** 2 <= n:
        if n % f == 0:
            factor.append(f)
            n //= f
        else:
            f += 1
    if n > 1:
        factor.append(n)
    return factor

p = prime_factorization(P)
c = Counter(p)

l = []
j = []
for k, v in list(c.items()):
    if N <= v:
        l.append(k)
        j.append(v//N)
ans = 1

for i,v in zip(l,j):
    ans *= i**v

print(ans)
# Original solution
# -*- coding: utf-8 -*-

from sys import stdin

n,x = [int(i) for i in stdin.readline().split()]
limit = int(x ** (1.0/n)) + 1

def factorize(x):
    ans = 1

    p = 2
    if x % p == 0:
        count = 1
        x /= p
        while x % p == 0:
            count += 1
            x /= p
        if count >= n:
            ans = ans * (p ** (count // n))

    for p in range(3, limit, 2):
        if x % p == 0:
            count = 1
            x /= p
            while x % p == 0:
                count += 1
                x /= p
            if count >= n:
                ans = ans * (p ** (count // n))
        if x < p * p:
            break
    return ans

if x == 1:
    print((1))
elif n == 1:
    print(x)
else:
    ans = factorize(x)
    print(ans)

# Optimized solution
# -*- coding: utf-8 -*-
    
from sys import stdin
    
n,x = [int(i) for i in stdin.readline().split()]
limit = int(x ** (1.0/n)) + 1
    
def devide_counter(x, p):
    count = 1
    x = x // p
    while x % p == 0:
        count += 1
        x = x // p
    return x, count
    
def factorize(x):
    ans = 1
    
    p = 2
    if x % p == 0:
        x, count = devide_counter(x, p)
        if count >= n:
            ans = ans * (p ** (count // n))
    
    for p in range(3, limit, 2):
        if x % p == 0:
            x, count = devide_counter(x, p)
            if count >= n:
                ans = ans * (p ** (count // n))
        if x < p * p:
            break
    return ans
    
if x == 1:
    print((1))
elif n == 1:
    print(x)
else:
    ans = factorize(x)
    print(ans)
# Original solution
n,p=list(map(int,input().split()))
a=[i for i in range(int(p**(1/n))+1)]
a[1]=0
b=int(p**0.5)
for j in a:
    if j>b:
        break
    elif j==0:
        continue
    for k in range(2*j,len(a),j):
        a[k]=0
c=[l for l in a if l!=0]
for m in range(len(c)):
    d=0
    while p%c[m]==0:
        p//=c[m]
        d+=1
    c[m]=[c[m],d]
e=1
for v in c:
    e*=v[0]**(v[1]//n)
print(e)

# Optimized solution
n,p=list(map(int,input().split()))
if n==1:
    print(p)
    quit()
a=[i for i in range(int(p**(1/n))+1)]
a[1]=0
b=int(p**0.5)
for j in a:
    if j>b:
        break
    elif j==0:
        continue
    for k in range(2*j,len(a),j):
        a[k]=0
c=[l for l in a if l!=0]
for m in range(len(c)):
    d=0
    while p%c[m]==0:
        p//=c[m]
        d+=1
    c[m]=[c[m],d]
e=1
for v in c:
    e*=v[0]**(v[1]//n)
print(e)
# Original solution
a,b=list(map(int ,input().split()))
x=int(pow(b,1/a))
x+=1
while x>=1:
    if b%(x**a)==0:
        print(x)
        exit()
    x-=1



# Optimized solution
a,b=list(map(int ,input().split()))
x=int(pow(b,1/a)+0.00001)
while x>=1:
    if b%(x**a)==0:
        print(x)
        exit()
    x-=1
# Original solution
n,p=list(map(int,input().split()))
if n==1:
    print(p)
else:
    d=int(p**(1/n))
    k=1
    for i in range(d+1,0,-1):
        if p%(i**n)==0:
            k=i
            print(k)
            break
    else:
        print(k)

# Optimized solution
n,p=list(map(int,input().split()))
if n==1:
    print(p)
else:
    def r(n,p):
        d=int(p**(1/n))
        k=1
        for i in range(1,d+1):
            if p%(i**n)==0:
                k=i
        return k
    c=1
    while r(n,p)!=1:
        s=r(n,p)
        c*=s
        p=p/(s**n)
    print(c)
# Original solution
n,p=list(map(int, input().split()))
ans=1
m=int(pow(p,1/n))+1
if n==0:
    print(p)
else:
    m=int(pow(p,1/n))+1
    i=2
    c=0
    while(i<=p and i<=m):
        #print('i,p=',i,p)
        if p % i == 0:
            p=p/i
            c=c+1
            if p % i != 0:
                #print('i**(c//n)=',i**(c//n))
                ans = ans * ( i**(c//n) )
                i=i+1
                c=0
        else:
            i=i+1
    print(ans)


# Optimized solution
n,p=list(map(int,input().split()))
if n==1:
    print(p)
    exit()
a=1
for i in range(2,int(p**0.5)+2):
  if p%i==0:
    c=0
    while p%i==0:
      p//=i
      c+=1
    a*=max(i**(c//n),1)
  if p==1:
    break
print(a)
# Original solution
from collections import Counter

def prime_factor(n):
    res = Counter()
    for i in range(2, int(n**.5) + 1):
        while n % i == 0:
            res[i] += 1
            n //= i
    if n != 1:
        res[n] += 1
    return res

N, P = list(map(int, input().split()))
cnt = prime_factor(P)
ans = 1
for f in cnt:
    if cnt[f] >= N:
        ans *= f ** (cnt[f] // N)
print(ans)

# Optimized solution
from collections import Counter

def prime_factorize_fast(n, res=Counter()):
    while n % 2 == 0:
        res[2] += 1
        n //= 2
    while n % 3 == 0:
        res[3] += 1
        n //= 3
    d = 5
    step = 2
    while d <= int(n ** .5):
        while n % d == 0:
            res[d] += 1
            n //= d
        d += step
        step = 6 - step
    if n != 1:
        res[n] += 1
    return res

N, P = list(map(int, input().split()))
cnt = prime_factorize_fast(P)
ans = 1
for f in cnt:
    if cnt[f] >= N:
        ans *= f ** (cnt[f] // N)
print(ans)
# Original solution
N,P=list(map(int,input().split()))
maxfac = int(P**(1/N))
# print(range(1,maxfac+1))
if N==1:
    print(P)
    exit()
for i in range(1,maxfac+2)[::-1]:
    p = i**N
    # print(P%p)
    if P%p == 0:
        print(i)
        break


# Optimized solution
N,P=list(map(int,input().split()))
maxfac = int(P**(1/N))
# print(range(1,maxfac+1))
if N==1:
    print(P)
    exit()
elif N > 10**6:
    print((1))
    exit()
for i in range(1,maxfac+2)[::-1]:
    p = i**N
    # print(P%p)
    if P%p == 0:
        print(i)
        break
# Original solution
N,P=list(map(int,input().split()))
maxfac = int(P**(1/N))
# print(range(1,maxfac+1))
if N==1:
    print(P)
    exit()
elif N > 10**6:
    print((1))
    exit()
for i in range(1,maxfac+2)[::-1]:
    p = i**N
    # print(P%p)
    if P%p == 0:
        print(i)
        break


# Optimized solution
N,P=list(map(int,input().split()))
maxfac = round(P**(1/N))
# print(range(1,maxfac+1))
if N==1:
    print(P)
    exit()
for i in range(1,maxfac+1)[::-1]:
    p = i**N
    # print(P%p)
    if P%p == 0:
        print(i)
        break
# Original solution
from operator import itemgetter
import collections
N, P = list(map(int, input().split()))

factor = collections.defaultdict(int)

p = 2
n = P
while n > 1:
    while n % p == 0:
        factor[p] += 1
        n //= p
    p += 1

ans = 1
for key, value in list(factor.items()):
    num = value
    while num >= N:
        ans *= key
        num -= N
print(ans)


# Optimized solution
import math
N, P = list(map(int, input().split()))

for i in reversed(list(range(1, round(math.pow(P, 1 / N)) + 1))):
    if P % (i ** N) == 0:
        print(i)
        exit()
# Original solution
import math

N, P = list(map(int, input().split()))
max_value = math.floor(pow(P, 1/N)+1)
ans = 1

if N == 1:
    ans = P
else:
    for i in range(1, max_value+1):
        mod = i ** N
        if P % mod == 0:
            ans = i

print(ans)


# Optimized solution
import math

N, P = list(map(int, input().split()))
max_value = round(pow(P, 1/N)) + 1 
ans = 1

if N == 1:
    ans = P
else:
    for i in range(1, max_value):
        mod = i ** N
        if P % mod == 0:
            ans = i

print(ans)
# Original solution
import math

N, P = list(map(int, input().split()))

for i in range(int(math.pow(P, 1 / N)) + 1, 0, -1):
    if P % (i ** N) == 0:
        print(i)
        break


# Optimized solution
n, p = list(map(int, input().split()))
if n == 1:
    print(p)
else:
    for i in range(1, round(p**(1/n))+1):
        if p % i**n ==0:
            res = i
    print(res)
# Original solution
import math

N, P = list(map(int, input().split()))

for i in range(1, round(math.pow(P, 1 / N)) + 1):
    if P % (i ** N) == 0:
        now_max = i

print(now_max)

# Optimized solution
import math

N, P = list(map(int, input().split()))

if N == 1:
    print(P)
else:
    for i in range(1, round(math.pow(P, 1 / N)) + 1):
        if P % (i ** N) == 0:
            now_max = i
    
    print(now_max)
# Original solution
n, p = list(map(int, input().split()))

if n == 1:
    print(p)
else:
    ans = 1
    g = 1
    while pow(g, n) <= p:
        if p % pow(g, n) == 0:
            ans = max(ans, g)
        g += 1
    print(ans)



# Optimized solution
def prime_factor(n):
    ret = {}
    p = 2
    while p*p <= n:
        while n % p == 0:
            ret[p] = ret.get(p, 0) + 1
            n //= p
        p += 1
    if n != 1: ret[n] = 1
    return ret

n, p = list(map(int, input().split()))

primes = prime_factor(p)
ans = 1

for p, e in list(primes.items()):
    ans *= max(1, p**(e//n))

print(ans)