import math
n,p=map(int,input().split())
s=0
I=p
R=int(I)
l=[]
if p==1:
  print(1)
  exit()
if n==1:
  print(p)
  exit()
while s==0:
  for i in range(2,int(math.sqrt(R))):
    if I%i==0:
      I=I/i
      if I==1:
          s=1
      l.append(i)
      break
l2=list(set(l))
x=1
for i in l2:
  y=l.count(i)
  if y>=n:
    x*=pow(i,y//n)
print(x)