#include <bits/stdc++.h>
using namespace std;
long long n, p, ans = 1;
int main() {
  long long i, c;
  cin >> n >> p;
  for (i = 2; i * i <= p && p > 1; i++) {
    for (c = 0; p % i == 0; p /= i) c++;
    c /= n;
    while (c--) ans *= i;
  }
  cout << ans;
  return 0;
}
