#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long n, p;
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
  } else {
    for (long long i = floor(sqrt(p)); i > 0; i--) {
      if (p % (int)(pow(i, n)) == 0) {
        cout << i << endl;
        break;
      }
    }
  }
  return 0;
}
