#include <bits/stdc++.h>
using namespace std;
long long pow_kai(long long a, long long n) {
  long long x = 1;
  while (n > 0) {
    if (n & 1) {
      x = x * a;
    }
    a = a * a;
    n >>= 1;
  }
  return x;
}
signed main() {
  long long N, P;
  cin >> N >> P;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  long long ans = 1;
  for (long long i = 1; i <= P; i++) {
    if (pow_kai(i, N) > P) {
      break;
    }
    if (P % pow_kai(i, N) == 0) {
      P /= pow_kai(i, N);
      ans *= i;
    }
  }
  cout << ans << endl;
}
