n,p = map(int,input().split())
a = []
i = 2
k = p

if n == 1:
  c = p
else:
  while (p>1) and (i < int(k**0.5) + 4):
      c = 0
      while p%i == 0:
          p = p/i
          c += 1
      a.append([i,c])
      i += 1

  c = 1
  for i in range(len(a)):
    if a[i][1] >= n:
      c = c* a[i][0] * int(a[i][1]/n)

print(c)
