#include <bits/stdc++.h>
int main() {
  long N, P;
  long i, j;
  long A[1000000];
  long ans = 1;
  scanf("%ld %ld", &N, &P);
  if (P == 1) {
    ans = 1;
    goto Ans;
  }
  if (N == 1) {
    ans = P;
    goto Ans;
  }
  i = pow(P, 1 / double(N));
  for (j = 2; j <= i; P % j == 0 ?: j++) {
    if (P % j == 0) {
      P /= j;
      A[j]++;
    }
  }
  for (j = 2; j <= i; j++) {
    A[j] = A[j] / N;
    if (A[j]) ans *= j;
  }
Ans:;
  printf("%ld\n", ans);
  return 0;
}
