#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, p, ans = 1, temp = 1, cap = 0, count;
  cin >> n >> p;
  if (n >= 50) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 2; i < p; i++) {
    temp = 1;
    for (int j = 0; j < n; j++) {
      temp *= i;
    }
    if (temp > p) cap = i;
    if (cap) break;
  }
  for (long long i = 2; i <= p; i++) {
    if (cap == i) break;
    count = 0;
    while (p % i == 0) {
      count++;
      p /= i;
    }
    while (count >= n) {
      ans *= i;
      count -= n;
    }
  }
  cout << ans << endl;
  return 0;
}
