#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  cin >> n >> p;
  long long tei = 2;
  long long tmp = 0;
  long long kekka = 1;
  while (p != 1) {
    if (p % tei == 0) {
      tmp++;
      p /= tei;
    } else {
      if (tmp >= n) kekka *= tei;
      tei++;
      tmp = 0;
    }
  }
  if (tmp >= n) kekka *= tei;
  cout << kekka << endl;
  return 0;
}
