#include <bits/stdc++.h>
using namespace std;
long long n, p;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> p;
  map<int, int> d;
  long long div = 2;
  while (div * div <= p) {
    if (p % div == 0) {
      d[div]++;
      p /= div;
    } else {
      div++;
    }
  }
  if (p != 1) {
    d[p]++;
    p = 1;
  }
  long long ans = 1;
  for (auto x : d) {
    if (x.second >= n) {
      ans *= (1ll * x.first * (x.second / n));
    }
  }
  cout << ans << endl;
  return 0;
}
