n, p = gets.chomp.split.map(&:to_i)
# max = (p ** (1.0/n)).round
ans = 1

soinsu = []
tmp = p+0
i = 2
while tmp > 0
  if tmp ** (1.0/2) < i
    soinsu << tmp
    break
  end
  if tmp%i==0
    soinsu << i
    soinsu << p/i
    tmp /= i
    i = 2
  else
    i+=1
  end
end

# for i in 2..(p**(1.0/2))
#   if p%i == 0
#     soinsu << i
#     soinsu << p/i
#   end
# end
soinsu.sort!
soinsu.uniq!
# p soinsu

ary = []
soinsu.each do |num|
  if p % (num**n)==0
    ary << num
  end
end
ans = 1
ary.each do |i|
  ans *= i
end

puts ans
