import math
n,p = list(map(int, input().split()))
m = int(math.sqrt(p))
if n == 1:
  print(p)
else:
  d = []
  for i in range(m, m//2, -1):
    if p % (i**n) == 0:
      print(i)
      break
    elif p % ((m-i+1)**n) == 0:
      d.append(m-i+1)
  else:
    print(max(d))