#include <bits/stdc++.h>
int main() {
  long long n, p, t;
  scanf("%lld %lld", &n, &p);
  int i;
  int fl = floor(pow(p, 1.0 / (double)n));
  for (i = fl; i >= 1; i -= 1) {
    if (p % (long long)pow(i, n) == 0) {
      t = i;
      break;
    }
  }
  printf("%lld", t);
}
