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