require "prime"
N, P = gets.split.map &:to_i
gcd = 1
tmp= Math.sqrt(P).to_i
if N >= 2
  if N < P
    Prime.each(tmp) do |p|
      _p = P
      cnt = 0
      while _p % p == 0
        _p /= p
        cnt += 1
      end
      gcd *= p**(cnt/N) if cnt > 0
    end
  end
  puts gcd
else
  puts P
end

