N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=int(P/i)
      count+=1
    cn=int(count/N)
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))