#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
int main() {
  ll n, p;
  cin >> n >> p;
  ll res = 1;
  for (ll i = 2; i * i <= p; i++) {
    if (p % i == 0) {
      ll tmp = 0;
      while (p % i == 0) {
        tmp++;
        p /= i;
      }
      if (tmp >= n) res *= i * (tmp / n);
    }
  }
  if (n == 1)
    cout << p << endl;
  else
    cout << res << endl;
}
