#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
template <typename T = ll>
inline T in() {
  T ret;
  cin >> ret;
  return ret;
}
ll mypow(ll b, ll e) {
  return e == 0 ? 1 : e % 2 == 0 ? mypow(b * b, e / 2) : b * mypow(b, e - 1);
}
signed main() {
  ll n = in(), p = in();
  for (ll i = pow(p, 1.0 / n);; --i) {
    if (p % mypow(i, n) == 0) {
      cout << i << endl;
      break;
    }
  }
}
