#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
namespace atcoder {
void judge_outer(bool judge_exp, string ok = "Yes", string ng = "No") {
  if (judge_exp) {
    cout << ok << endl;
  } else {
    cout << ng << endl;
  }
}
template <typename T>
T ncr(T left, T right) {
  right = min(left - right, right);
  T ans = 1;
  for (T i = 1; i <= right; i++) {
    ans = ans * (left - right + i) / i;
  }
  return ans;
}
const int LIMIT = 1000000007;
const int tenfive = 100000;
}  // namespace atcoder
using namespace atcoder;
int main() {
  lli N, P;
  cin >> N >> P;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  int ans = 1;
  for (lli i = 1; pow(i, N) < P; i++) {
    if (P % (lli)pow(i, N) == 0) {
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
