#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  vector<long long> v;
  cin >> n >> p;
  for (long long i = 2; p != 1 && i <= p; i++) {
    if (p % i == 0) {
      v.push_back(i);
      p /= i;
      i--;
      continue;
    }
  }
  int cnt = 0, num = -1, ans = 1;
  for (long long i = 0; i < v.size(); i++) {
    if (v[i] == num)
      cnt++;
    else
      cnt = 1;
    if (cnt == n) {
      ans *= v[i];
      cnt = 0;
    }
    num = v[i];
  }
  cout << ans << endl;
}
