#include <bits/stdc++.h>
using namespace std;
map<long long, int> divisor_cnt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N, P;
  cin >> N >> P;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  long long p = P;
  long long divisor = 2;
  while (p && divisor < p) {
    while (p % divisor != 0) {
      divisor++;
    }
    while (p % divisor == 0) {
      p = p / divisor;
      if (!divisor_cnt.count(p)) divisor_cnt[p] == 0;
      divisor_cnt[divisor]++;
    }
  }
  long long ans = 1;
  for (auto i : divisor_cnt) {
    ans *= pow(i.first, i.second / N);
  }
  cout << ans << endl;
  return 0;
}
