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