#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> mp;
const int N = 10000005;
int lp[N + 1];
vector<int> pr;
void sieve() {
  for (int i = 2; i <= N; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && i * pr[j] <= N; ++j)
      lp[i * pr[j]] = pr[j];
  }
}
long long bexp(long long a, long long n) {
  long long ret = 1;
  while (n > 0) {
    if (n & 1) ret = ret * a;
    a = a * a;
    n = n / 2;
  }
  return ret;
}
void love() {
  sieve();
  long long n, p;
  cin >> n >> p;
  long long ans = 0;
  if (n == 1) {
    ans = p;
  } else if (p == 1) {
    ans = 1;
  } else {
    ans = 1;
    long long tp = p;
    if (n >= 40)
      ans = 1;
    else {
      ans = 1;
      for (long long i = 0; i <= pr.size() - 1 && p > 0; i++) {
        while (p % pr[i] == 0 && pr[i] <= p) {
          mp[pr[i]]++;
          p = p / pr[i];
        }
      }
      for (auto it = mp.begin(); it != mp.end(); ++it) {
        long long k = it->first;
        long long freq = it->second;
        if (freq >= n) {
          ans = ans * (freq / n * k);
        }
      }
    }
    assert(ans > 0);
  }
  cout << ans << endl;
}
int main() {
  love();
  return 0;
}
