#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 30);
int main() {
  long long n, pair<int, int>;
  cin >> n >> pair<int, int>;
  if (n == 1) {
    cout << pair<int, int> << endl;
    return 0;
  }
  pair<int, int> /= n;
  vector<long long> v;
  for (long long i = 2; i * i <= pair<int, int>; i++) {
    bool sosuu = true;
    for (long long j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        sosuu = false;
        break;
      }
    }
    if (sosuu == false)
      continue;
    else {
      long long cnt = 0;
      while (pair<int, int> % i == 0) {
        pair<int, int> /= i;
        cnt++;
      }
      if (cnt == n) v.push_back(i);
    }
  }
  long long ans = 1;
  for (int i = 0; i < v.size(); i++) {
    ans *= v[i];
  }
  cout << ans << endl;
}
