#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, P;
  cin >> N >> P;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  if (N * N > P) {
    cout << 1 << endl;
    return 0;
  }
  long long ans = 1;
  for (int i = 2; i * i <= P + 1; i++) {
    int cnt = 0;
    while (P % i == 0) {
      P /= i;
      cnt++;
      if (cnt == N) {
        ans *= i;
        cnt = 0;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
