#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  cin >> n >> p;
  long long ans = 1;
  long long i = 2;
  while (1) {
    if (ans % i == 0) {
      i++;
      continue;
    }
    if (p % i != 0) {
      i++;
      continue;
    }
    long long n_pow = (long long)pow((double)i, (double)n);
    if (p < n_pow) break;
    while (p % n_pow == 0) {
      p /= n_pow;
      ans *= i;
    }
    i++;
    if (p == 1) break;
  }
  std::cout << ans << endl;
  return 0;
}
