require 'prime'

n,pr=gets.chomp.split(" ").map { |e| e.to_i }

a=pr.prime_division


def search(a,n)
  ans = 1
  for x in a do
    i = x[1]/n
    ans *= (x[0]**i)
  end
  return ans
end

puts search(a,n)

