#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
int main() {
  long long n, p;
  cin >> n >> p;
  int m = sqrt(p);
  vector<long long> d(m + 2);
  for (int i = 0; i < (m + 2); i++) d[i] = 0;
  long long j = 2;
  while (1) {
    if (p % j == 0) {
      p /= j;
      d[j]++;
      continue;
    }
    j++;
    if (j > m + 1) break;
  }
  long long ans = 1;
  for (int i = 2; i <= m + 1; i++) {
    long long k = d[i] / n;
    if (!k) continue;
    ans *= i * k;
  }
  if (1 / n == 1) ans *= p;
  cout << ans << endl;
}
