#include <bits/stdc++.h>
using namespace std;
vector<long long> is_Prime(long long N, long long cnt) {
  vector<long long> Prime;
  vector<bool> check(N + 1, true);
  check[0] = false;
  check[1] = false;
  for (long long i = 2; i * i <= N && pow(i, cnt) <= N; ++i) {
    if (check[i]) {
      for (long long k = i * 2; k < N && pow(k, cnt) < N; k += i) {
        check[k] = false;
      }
    }
  }
  for (long long i = 2; i < N && pow(i, cnt) <= N; ++i) {
    if (check[i]) {
      Prime.emplace_back(i);
    }
  }
  return Prime;
}
map<long long, long long> prime_factors(long long P, long long N) {
  map<long long, long long> res;
  if (P == 1) {
    res[P] = 1;
    return res;
  }
  long long tm = P;
  for (long long i = 2; pow(i, N) <= tm; ++i) {
    while (tm % i == 0) {
      ++res[i];
      tm /= i;
    }
  }
  if (P != 1) res[P] = 1;
  return res;
}
int main() {
  long long N, P;
  cin >> N >> P;
  long long ans = 1;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  map<long long, long long> res = prime_factors(P, N);
  for (auto it = res.begin(), end = res.end(); it != end; ++it) {
    if (it->second >= N) {
      ans *= it->first;
    }
  }
  cout << ans << endl;
}
