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

if n == 1
  puts p
  exit 0
end

start = (p ** (1.0 / n)).to_i + 1

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

p gcd
