# frozen_string_literal: true

$factors = {}

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

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

puts ans
