#include <bits/stdc++.h>
using namespace std;
using ulli = unsigned long long int;
int main(void) {
  int N;
  ulli P, i;
  cin >> N >> P;
  map<ulli, ulli> elem;
  for (i = 2; i * i < P; i++) {
    while (P % i == 0) {
      P = P / i;
      if (elem.count(i) == 0)
        elem[i] = 1;
      else
        elem[i]++;
    }
  }
  if (P > 1) {
    if (elem.count(P) == 0)
      elem[P] = 1;
    else
      elem[P]++;
  }
  ulli ans = 1;
  for (auto p : elem) {
    if (p.second / N > 0)
      for (i = 0; i < p.second / N; i++) ans = ans * p.first;
  }
  cout << ans << endl;
  return 0;
}
