#include <bits/stdc++.h>
using namespace std;
map<int, int> get_prime_factors_list(long N) {
  map<int, int> m;
  for (int i = 2; i * i <= N; i++) {
    if (N % i != 0) continue;
    while (N % i == 0) {
      m[i]++;
      N /= i;
    }
  }
  if (N > 1) m[N] = 1;
  return m;
}
int main() {
  long N, P;
  cin >> N >> P;
  map<int, int> ret;
  ret = get_prime_factors_list(P);
  int ans = 1;
  for (auto it = ret.begin(); it != ret.end(); it++) {
    ans *= pow(it->first, it->second / N);
  }
  cout << ans << endl;
}
