#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  map<long long, long long> yakusuu;
  cin >> n >> p;
  while (p % 2 == 0) {
    yakusuu[2]++;
    p /= 2;
  }
  for (int i = 3; i * i <= p; i += 2) {
    while (p % i == 0) {
      yakusuu[i]++;
      p /= i;
    }
  }
  yakusuu[p]++;
  long long ans = 1;
  for (auto itr = yakusuu.begin(); itr != yakusuu.end(); itr++) {
    long long x = itr->second / n;
    if (x > 0) ans *= itr->first * x;
  }
  cout << ans << endl;
  return 0;
}
