#include <bits/stdc++.h>
bool isP[10000001];
std::vector<long long> px;
void siever(void) {
  memset(isP, 1, sizeof(isP));
  isP[0] = 0;
  isP[1] = 0;
  for (long long p = 2; p * p < 10000001; p++) {
    if (isP[p]) {
      for (long long i = p * p; i < 10000001; i += p) isP[i] = 0;
    }
  }
  for (long long i = 2; i < 10000001; i++) {
    if (isP[i]) px.push_back(i);
  }
  return;
}
int main(void) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  siever();
  long long n, p;
  std::cin >> n >> p;
  long long ag = 1;
  for (int i = 0, j = (int)px.size(); i < j; i++) {
    long long xd = px[i], ct = 0;
    while (!(p % xd)) {
      p /= xd;
      ct++;
    }
    if (ct / n) ag *= (ct / n) * xd;
  }
  if (p > 1) {
    if (n == 1) ag *= p;
  }
  std::cout << ag << "\n";
  return 0;
}
