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 = 1L
  var cont = false
  var ret = 1L
  do {
    x += 1L
    //val xN = (1L to N).foldLeft(1L)( (a, _) => a * x )
    //val xN:Long = Math.pow(x, N).toLong
    var xN = 1L
    var j = 0L
    while(j < N){
      xN *= x
      j += 1L
    }
    if(P % xN == 0L) ret = x
    cont = xN <= P
  } while(cont)
  println(ret)
}
