#include <bits/stdc++.h>
using namespace std;
long long n, p, ans = 1;
long long mypow(long long a, long long b) {
  long long re = 1;
  for (long long i = 0; i < b; i++) {
    re *= a;
  }
  return re;
}
signed main() {
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
    goto ioi;
  }
  if (p % n != 0) goto joi;
  for (long long i = 1; i <= (p / n); i++) {
    if (mypow(i, n) > p) break;
    if (p % mypow(i, n) == 0) ans = i;
  }
joi:;
  cout << ans << endl;
ioi:;
  system("PAUSE");
}
