#include <bits/stdc++.h>
using namespace std;
map<unsigned long long, unsigned long long> mp;
class Calc {
  unsigned long long a;

 public:
  void decompositPrime(unsigned long long n);
};
void Calc::decompositPrime(unsigned long long n) {
  a = 2;
  while (n >= a * a) {
    if (n % a == 0) {
      mp[a] = mp[a]++;
      n /= a;
    } else {
      a++;
    }
  }
  mp[n] = mp[n]++;
}
int main() {
  unsigned long long n;
  unsigned long long p;
  unsigned long long ans = 1;
  Calc objCalc;
  cin >> n >> p;
  objCalc.decompositPrime(p);
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if (itr->second / n > 0) {
      ans *= pow(itr->first, itr->second / n);
    }
  }
  cout << ans << endl;
  return 0;
}
