#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long n, p, pp;
  int count = 0;
  cin >> n >> p;
  if (n == 1 || p == 1) {
    cout << p;
    return 0;
  }
  pp = p / n;
  vector<long> prime;
  int flag;
  for (int i = 2; i <= 100000; i++) {
    flag = 0;
    for (int j = 2; j < i; j++) {
      if (i % j == 0) {
        flag = 1;
        break;
      }
    }
    if (!flag) prime.push_back(i);
  }
  int size = prime.size();
  vector<int> ans;
  long power = 1;
  for (int k = 0; k < size; k++) {
    power = powl(prime[k], n);
    if (power > pp) break;
    if (pp % power == 0) ans.push_back(prime[k]);
  }
  int result = 1;
  for (int x = 0; x < ans.size(); x++) {
    result *= ans[x];
  }
  cout << result;
  return 0;
}
