#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, p, ans = 1;
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
    return 0;
  }
  long long temp = p;
  for (long long i = 2; p >= i * i; i++) {
    long long tmp = temp;
    long long x = 1, cnt = 0;
    while (x == 1) {
      if (tmp % i != 0) {
        x = 0;
      } else {
        cnt++;
        tmp /= i;
      }
    }
    long long temp1 = 1;
    for (long long j = 0; j < (cnt / n); ++j) {
      temp1 *= i;
    }
    ans *= temp1;
    temp /= temp1 * temp1;
  }
  cout << ans << endl;
  return 0;
}
