n, p = STDIN.gets.split(' ').map(&:to_i)

if n == 1
  puts p
  exit 0
end

start = p
1.upto(p) do |i|
  if (10 ** i) > p
    start = 10 ** ((Math.log(10 ** i, 10).to_i + 1) / n)
    break
  end
end

gcd = 1
start.downto(2) do |i|
  product = p

  if (i ** n) > product
    next
  end

  if product % (i ** n) != 0
    next
  end

  product /= i ** n

  if product < 0
    next
  end

  gcd = i
  break
end

puts gcd
