#include <bits/stdc++.h>
using namespace std;
long long n, p, ans = 1, tot;
int main() {
  cin >> n >> p;
  for (long long i = 2; i <= p; ++i, tot = 0) {
    while (p % i == 0) p /= i, tot++;
    for (; tot / n; tot -= n) ans *= i;
  }
  printf("%lld", ans);
  return 0;
}
