#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, p;
  cin >> n >> p;
  unsigned long long int tmp = 0;
  float t = 1.0000000000000000 / n;
  int s = pow(p, t);
  for (int i = s; i > 0; i--) {
    unsigned long long k = pow(i, n);
    if (p % k == 0) {
      tmp = i;
      break;
    }
  }
  cout << tmp << endl;
}
