#include <bits/stdc++.h>
int main() {
  int max = 1;
  long N, P;
  scanf("%ld %ld", &N, &P);
  int t = 2;
  while (pow(t, N) <= P) {
    if (P % (int)(pow(t, N)) == 0) max == t;
    t++;
  }
  printf("%d", max);
  return 0;
}
