#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
void solve() {}
vector<pair<long long, long long>> prime_factorize(long long n) {
  vector<pair<long long, long long>> res;
  for (long long p = 2; p * p <= n; ++p) {
    if (n % p != 0) continue;
    int num = 0;
    while (n % p == 0) {
      ++num;
      n /= p;
    }
    res.push_back(make_pair(p, num));
  }
  if (n != 1) res.push_back(make_pair(n, 1));
  return res;
}
int main() {
  int N;
  long long P;
  cin >> N >> P;
  auto fac = prime_factorize(P);
  long long res = 1;
  for (auto p : fac) {
    for (int j = 0; j < p.second / N; ++j) res *= p.first;
  }
  cout << res << endl;
  return 0;
}
