#include <bits/stdc++.h>
std::deque<long> q;
bool IsPrime(long num) {
  size_t l = q.size();
  long s = (long)sqrt(num);
  for (size_t i = 0; i < l; i++) {
    if (num % q[i] == 0) {
      return false;
    }
    if (q[i] > s) break;
  }
  q.push_back(num);
  return true;
}
int main() {
  long N, P, gcd = 1;
  scanf("%ld %ld", &N, &P);
  long powp = (long)pow(P, (double)1 / N);
  for (long i = 2; i <= powp; i++) {
    if (!IsPrime(i)) continue;
    long j = 0;
    for (; P % i == 0; P /= i) j++;
    if (j >= N)
      for (int k = 0; k < j / N; k++) gcd *= i;
  }
  printf("%ld\n", gcd);
  return 0;
}
