#!/usr/bin/env ruby

n, p = gets.split(/ /).map(&:to_i)

array = []

q = p
a = 2
while (a * a < p) do
  while (q % a == 0) do
    array << a
    q /= a
  end
  a += 1
end

j = 0
c = 1
ans = 1
#p array
array.each do |i|
  if (j == i)
    c += 1
    if (c == n)
      ans *= i
      c = 1
    end
  else
    c = 1
  end
  j = i
end

puts ans
