#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
    return 0;
  }
  long long ans = 1, lim = sqrt(p) + 1;
  for (long long i = 2; i <= lim; i++) {
    long long cnt = 0;
    while (p % i == 0) {
      p /= i;
      cnt++;
    }
    if (cnt / n > 0) {
      ans *= i * (cnt / n);
    }
  }
  cout << ans << endl;
}
