#!/usr/bin/env ruby

(n, p) = gets.chomp.split(/ /).map(&:to_i)
array = []
if (n == 1)
  puts p
  exit
end

if (p == 1)
  puts 1
  exit
end
pp = p
i = 2
while (p > 1 || i * i <= pp )
  while (p % i == 0)
    if (p % (i ** n) == 0)
      p /= (i ** n)
      array << i
    else
      p /= i
    end
  end
  i += 1
end
r = array.inject(1){|res, m|res * m}
puts r
