n,p = gets.split(" ").map!{|k| k.to_i}
require "prime"
a = Prime.prime_division(p)
b = 1
a.length.times do |j|
  if a[j][1] >= n
    c =  a[j][1] / n
    d =  a[j][0]**c
    b = b*d
  end
end
puts b

  