object Main extends App {
  val in = scala.io.Source.stdin.getLines().toIndexedSeq
  .map(_.split(' ').map(_.toLong))
  val in0 = in.head
  val N = in0(0)
  val P = in0(1)
  
  var x = 1
  var cont = false
  var ret = 1
  do {
    x += 1
    //val xN = (1 to N).foldLeft(x){ (a,_) => x
    val xN:Long = Math.pow(x, N).toLong
    val a = P % xN
    if(a == 0) ret = x
    cont = xN <= P
  } while(cont)
  println(ret)
}
