N, P = map(int, input().split())
n = 1
    
p = int(P ** (1/N))

for i in range(2, p + 1):
  while True:
    if P % (i ** N) == 0:
      n *= i
      P = P / (i ** N)
    else:
      break
  if P <= i ** N:
    break 
    
print(n)