#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  cin >> n >> p;
  long long ans = 1;
  long long ans0 = 1;
  while (1) {
    long long n_pow = pow((double)ans0, (double)n);
    if (p % n_pow == 0) {
      ans = ans0;
    }
    ans0++;
    if (p < n_pow) break;
  }
  cout << ans << endl;
  return 0;
}
