#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, p;
  cin >> n >> p;
  list<int> prime;
  prime.push_back(2);
  for (int i = 3; i < sqrt(p) + 1; i += 2) {
    bool is_p = true;
    for (auto j = (prime).begin(); j != (prime).end(); j++) {
      if (i < *j * *j) break;
      if (i % *j == 0) {
        is_p = false;
        break;
      }
    }
    if (is_p) {
      prime.push_back(i);
    }
  }
  long long int ret = 1;
  for (auto i = (prime).begin(); i != (prime).end(); i++) {
    if (p <= 1) {
      break;
    }
    int pn = 0;
    while (p % *i == 0) {
      p /= *i;
      pn++;
    }
    if (pn >= n) {
      ret *= *i * (pn / n);
    }
  }
  if (p > 1 && n == 1) {
    ret *= p;
  }
  cout << ret << endl;
  return 0;
}
