
import java.util.Scanner
import scala.collection.mutable.ArrayBuffer

object Main extends App {
  val sc = new Scanner(System.in)
  def next(): String = sc.next()
  def nextInt(): Int = next().toInt
  def nextLong(): Long = next().toLong

  def taskA(): Unit = {
    val n = next()
    println(n.count(_ == '2'))
  }

  def taskB(): Unit = {
    val n, h, w = nextInt()
    val ans = 1.to(n).count { _ =>
      val a, b = nextInt()
      a >= h && b >= w
    }
    println(ans)
  }

  def taskC(): Unit = {
    val n, p = nextLong()
    val ps = factorize(p)
    var res = 1L
    for ((p, e) <- ps) {
      for (_ <- 1L to e / n)
        res *= p
    }
    println(res)
  }

  def factorize(x: Long): Seq[(Long, Int)] = {
    val res = new ArrayBuffer[(Long, Int)]()
    var p = 2L
    var tmp = x
    while (p * p <= tmp) {
      var exp = 0
      while (tmp % p == 0) {
        exp += 1
        tmp /= p
      }
      if (exp != 0) res.append((p, exp))
      p += 1
    }
    if (tmp != 1) res.append((tmp, 1))
    res
  }

  def test(): Unit = {
    require(factorize(2) == Seq((2, 1)))
    require(factorize(3) == Seq((3, 1)))
    require(factorize(4) == Seq((2, 2)))
    require(factorize(6) == Seq((2, 1), (3, 1)))
    require(factorize(1024) == Seq((2, 10)))
  }

  taskC()
}
