#include <bits/stdc++.h>
using namespace std;
long long N, P;
int main() {
  cin >> N >> P;
  long long d = 2, ans = 1;
  bool over = false;
  int cnt = 0;
  while (P % d == 0) {
    P /= d;
    cnt++;
  }
  for (int i = 0; i < cnt / N; i++) {
    ans *= d;
  }
  d++;
  while (!over) {
    int cnt = 0;
    while (P % d == 0) {
      P /= d;
      cnt++;
    }
    for (int i = 0; i < cnt / N; i++) {
      ans *= d;
    }
    d += 2;
    if (d * N > P) {
      over = true;
    }
  }
  cout << ans << endl;
}
