N, P = map(int,input().split())
 
output=1
 
for num in range(2,round(P**(1/N))+1):
  for i in range(100):
    if P%(num**N) == 0:
      P = P/(num**N)
      output = num*output
    else:
      break
 
print(output)