import scala.io.StdIn

object Main extends App {
  val Array(n, p) = StdIn.readLine.split(" ").map(_.toLong)

  val ans = if(n == 1) p
            else (1 to 993).filter(i => p % math.pow(i,n).toLong == 0).max

  println(ans)
}