n,m=gets.split.map(&:to_i)
hash=Hash.new(0)

(2..(Math.sqrt(m).ceil)).each do |i|
    while m % i == 0
        m /= i
        hash[i] += 1
    end
    break if m == 1
end

if m != 1
    hash[m] += 1
end

ans = 1
hash.each do |k,v|
    ans = ans * k ** (v/n) if v >= n
end

p ans
