#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15;
const long long MOD = 1e9 + 7;
map<long long, long long> prime_factor(long long n) {
  map<long long, long long> ret;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n]++;
  return ret;
}
int main() {
  long long n, p;
  cin >> n >> p;
  long long ans = 1;
  auto f = prime_factor(p);
  for (auto x : f) {
    long long cnt = x.second / n;
    if (cnt > 0) ans *= x.first * cnt;
  }
  cout << ans << endl;
  return 0;
}
