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