n,p = gets.split.map(&:to_i)
a = Hash.new(0)
for i in 2..10**6
    while p%i == 0
        p /= i
        a[i] += 1
    end
end
if p != 0
    a[p] += 1
end
ans = 1
a.each do |k,v|
    ans *= k**(v/n)
end
puts ans