#include <bits/stdc++.h>
using namespace std;
int main(void) {
  double n, p;
  cin >> n >> p;
  for (long long i = pow(p, 1.0 / n); i > 0; i--) {
    if (long long(p) % long long(pow(i, long long(n))) == 0) {
      cout << i << endl;
      return 0;
    }
  }
}
