# frozen_string_literal: true

$factors = Array.new
def factrize(n)
  (2..Math.sqrt(n)).each do |d|
    ex = 0
    while n % d == 0
      ex += 1
      n /= d
    end
    $factors << [d,ex]
  end
  if n != 1
    $factors << [n,1]
  end
end

n, p = gets.split.map(&:to_i)
ans = 1
factrize(p)
$factors.each do |factor|
  (1..factor[1] / n).each do
    ans *= factor[0]
  end
end

puts ans
