N, P = io.read("*n","*n")
io.read()

i = 3
a = 1

while P % (2^N) == 0 and P ~= 0 do
  P = P // (2^N)
  a = a * 2
end

while i^N <= P do
  while P % (i^N) == 0 and P ~= 0 do
    P = P // (i^N)
    a = a * i
  end
  
  i = i + 2
end

print(a)
