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