#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-14;
const double PI = acos(-1.0);
int main() {
  long long n, p;
  cin >> n >> p;
  int v[1000010];
  for (int i = (int)(0); i < (int)(1000010); i++) v[i] = 0;
  int i = 2;
  while (p > 1 && i < 1000010) {
    if (p % i == 0) {
      p /= i;
      v[i]++;
      continue;
    }
    i++;
  }
  long long ans = 1;
  for (int i = (int)(0); i < (int)(1000010); i++) {
    if (v[i] >= n) ans *= pow(i, (v[i] / n));
  }
  cout << ans << endl;
}
