#include <bits/stdc++.h>
using namespace std;
unsigned long long power(unsigned long long a, unsigned long long b) {
  unsigned long long product = a;
  for (unsigned long long i = 1; i < b; i++) {
    product = product * a;
  }
  return product;
}
int main() {
  unsigned long long n, p;
  cin >> n >> p;
  unsigned long long GCD = 1;
  unsigned long long max = pow(p, 1.0 / n);
  for (unsigned long long i = 1; i <= max; i++) {
    if (p % power(i, n) == 0) {
      GCD = i;
    }
  }
  cout << GCD << endl;
  return 0;
}
