# frozen_string_literal: true

$factors = Array.new(1000000,0)

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

n, p = gets.split.map(&:to_i)
ans = 1
factrize(p)
$factors.each_with_index do |factor,num|
    for i in 1..factor/n do
        ans *= num
    end
end

puts ans
