#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, p;
  cin >> n >> p;
  long long ans = 1;
  for (int i = 2; i <= p; i += (i == 2 ? 1 : 2)) {
    int cnt = 0;
    while (p % i == 0) {
      p /= i;
      cnt++;
    }
    if (cnt >= n) {
      long long t = cnt / n;
      ans *= i * t;
    }
  }
  cout << ans << endl;
}
