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