n,m = gets.chomp.split(" ").map(&:to_i)
require 'prime'
pr = []
Prime.each(10**6) do |prime|
  pr.push(prime)
end
pr2 = Array.new(pr.length, 0)
for i in 0..pr.length - 1
  while m % pr[i] == 0
    m /= pr[i]
    pr2[i] += 1
  end
  if m == 1
    break
  end
end
if m != 1
  pr2.push(1)
end
ans = 1
for i in 0..pr2.length - 1
  if pr2[i] >= n
    ans *= (pr[i]**(pr2[i]/n))
  end
end
puts ans
