#include <bits/stdc++.h>
int main(void) {
  long long N, P;
  long long ans;
  scanf("%lld %lld", &N, &P);
  for (ans = P; ans; ans--) {
    if (P % (long long)pow((double)ans, (double)N) == 0) {
      printf("%lld\n", ans);
      return 0;
    }
  }
}
