n,num=gets.chomp.split(" ").map(&:to_i)
if num == 1
 puts 1
 exit
elsif n == 1
 puts num
 exit
end
require 'prime'
ary = Prime.prime_division(num)
c = 1

ary.each do |a|
  if a[1] >= n
    ii = a[1] / n
    c = c * a[0] ** ii 
   end
end
puts c