import scala.annotation.tailrec
object Main extends App {

  import scala.io.StdIn._
  import scala.math._

  val Array(n, p) = readLine.trim.split(' ').map(_.toLong)
    // p == x^n = log(p) = n log(x) log(p) / n == log(x)
  if (n == 1){
    println(p)
  }else {
    val maxPrime = math.exp(math.log(p) / n)
    var res = 1L
    var current = p
    val primes = prime(maxPrime.toInt)
    for (primeFactor ← primes) {
      while (current % exponent(primeFactor, n) == 0) {
        res *= primeFactor
        current /= exponent(primeFactor, n)
      }
    }
    println(res)
  }
  def exponent(base: Long, exp: Long): Long = {
    exp match {
      case 0L ⇒ 1L
      case 1L ⇒ base
      case _ ⇒ exponent(base, exp / 2).let{it ⇒ it * it * exponent(base, exp % 2)}
    }
  }
  def prime(upper: Int): List[Int] = {
    val isPrime = Array.tabulate(upper + 1){_ ⇒ true}
    var res: List[Int] = Nil
    for (i ← 2 to math.sqrt(upper).ceil.toInt){
      if (isPrime(i)){
        for (j ← i * 2 to upper by i) {
          isPrime(j) = false
        }
      }
    }
    for (i ← 2 until isPrime.length){
      if (isPrime(i))
        res ::= i
    }
    res
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}