n, p = gets.split.map &:to_i
ans     = 1
count   = 0
divider = 2
i       = 2

while i <= p
  if p % i == 0
    p /= i
    count += 1
    if count == n
      ans   *= i
      count  = 0
    end

  else
    i     += 1
    count  = 0
  end
end

puts ans
