#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> prime;
  long long n, p;
  long long i, j;
  long long pw;
  bool isprime;
  long long sol = 1;
  long long cur;
  scanf("%lld %lld", &n, &p);
  if (n == 1) {
    printf("%lld\n", p);
    return 0;
  }
  prime.push_back(2);
  for (i = 3; (long long)pow(i, n) <= p; i += 2) {
    isprime = true;
    for (j = 0; j < prime.size() && prime[j] * prime[j] <= i; j++) {
      if (!(i % prime[j])) {
        isprime = false;
        break;
      }
    }
    if (isprime) {
      prime.push_back(i);
    }
  }
  for (i = 0; i < prime.size(); i++) {
    cur = (long long)pow(prime[i], n);
    if (p < cur) {
      break;
    }
    while (!(p % cur)) {
      p /= cur;
      sol *= prime[i];
    }
  }
  printf("%lld\n", sol);
  return 0;
}
