n,num=gets.chomp.split(" ").map(&:to_i)
if num == 1
 puts 1
 exit
elsif n == 1
 puts num
 exit
end
 
np = num
ln = np / 2
n_c = 0
c = 1
i = 2
ft = false
while (i <= ln && i <= np) do
  ni = i ** n
  if np % ni == 0
    c = c * i
    np = np / ni
  else
    i += 2
    i -= 1if i == 4
  end
end
 
puts c