import math
n,p=map(int,input().split())
s=0
I=p
R=int(I)
l=[]
if p==1:
  print(1)
  exit()
prev=1
c=1
x=1
while s==0:
  for i in range(2,R+1):
    if I%i==0:
      I=I/i
      if I==1:
          s=1
      if prev==i:
        c+=1
      else:
        prev=i
        c=1
      if c>=n:
        x*=i
        c=1
      break
print(x)
