#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n;
  unsigned long long int p;
  cin >> n >> p;
  unsigned long long int ans = 1;
  unsigned long long int max = pow(p, 1.0 / n) + 1;
  bool sosu[max + 1];
  for (unsigned long long int i = 0; i < max + 1; i++) sosu[i] = true;
  for (unsigned long long int i = 2; i < max + 1; i++) {
    if (!sosu[i]) continue;
    unsigned long long int mod = pow(i, n);
    if (p % mod == 0) {
      ans = i;
    } else
      for (unsigned long long int k = 1; k <= (max / i); k++)
        sosu[k * i] = false;
  }
  cout << ans;
}
