n, p = gets.split.map &:to_i
ans     = 1
count   = 0
divider = 2
i       = (p ** (1.0 / n)).to_i
x       = i ** n

while i > 1
  if p % x == 0
    p /= x
    ans *= i
  end
  i -= 1
  x  = i ** n
end

puts ans
