#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  long N, P, i, k, j, a, s;
  cin >> N >> P;
  s = (int)pow((double)(P), 1.0 / (double)(N));
  a = 0;
  for (i = 1; i <= s + 1; i++) {
    j = (int)pow((double)(i), (double)(N));
    if (P % j == 0 && j <= P) a = i;
  }
  cout << a;
  return 0;
}
