#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, P, PP, max = 0;
  cin >> N >> P;
  double A;
  A = pow((double)P, (double)1 / N);
  int A_i = 0;
  for (int i = 0; i < A; i++) {
    A_i = (int)A - i;
    double A_p = pow((double)A_i, (double)N);
    if (P % (long long int)A_p == 0) {
      max = A_i;
      break;
    }
  }
  cout << max << endl;
  return 0;
}
