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