#include <bits/stdc++.h>
using namespace std;
multiset<long long int> fact(long long int n) {
  multiset<long long int> ret;
  long long int a = 2;
  while (n != 1) {
    if (n % a == 0) {
      n /= a;
      ret.insert(a--);
    }
    a++;
  }
  return ret;
}
int main() {
  long long int n, p;
  cin >> n >> p;
  if (n == 1) {
    cout << p;
    return 0;
  }
  long long int ans = 1;
  auto l = fact(p);
  long long int cnt = 0;
  for (long long int i = 1; p >= pow(i - 1, n); ++i) cnt = i;
  for (int i = 0; i < cnt; ++i) {
    long long int tmp = l.count(i);
    if (tmp >= n) ans *= i;
  }
  cout << ans << endl;
}
