#include <bits/stdc++.h>
using namespace std;
long long pow(long long n, long long k) {
  long long r = 1;
  for (long long i = 0; i < k; i++) r *= n;
  return r;
}
signed main() {
  long long N, pair<long long, long long>;
  cin >> N >> pair<long long, long long>;
  long long res = 1;
  for (long long i = 1, c = pair<long long, long long>; i <= sqrt(c); i++) {
    long long ipn = pow(i, N);
    if (c % ipn == 0) {
      c /= ipn;
      res *= i;
    }
  }
  cout << res << endl;
}
