#include <bits/stdc++.h>
using namespace std;
long myPow(long x, long n) {
  if (n == 0) return 1;
  if (n % 2 == 0)
    return myPow(x * x, n / 2);
  else
    return x * myPow(x, n - 1);
}
int main() {
  long N, P;
  cin >> N >> P;
  double mm;
  double a = log((double)P) / ((double)N);
  mm = exp(a + 0.1);
  long im = (long)mm;
  long S;
  long ans;
  for (long i = im; i > 0; i--) {
    S = myPow(i, N);
    long s = P % S;
    if (s == 0) {
      ans = i;
      break;
    }
  }
  cout << ans;
  return 0;
}
