#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, p;
  cin >> n >> p;
  map<long long, int> m;
  for (int i = 2; i * i <= p; i++) {
    while (p % i == 0) {
      m[i]++;
      p /= i;
    }
  }
  if (p > 1) m[p]++;
  long long ans = 1;
  map<long long, int>::iterator itr;
  for (itr = m.begin(); itr != m.end(); itr++) {
    ans *= pow(itr->first, (itr->second) / n);
  }
  cout << ans;
}
