#include <bits/stdc++.h>
using namespace std;
long long n, p, i = 1, ans = 0;
int main(void) {
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
    return 0;
  } else {
    while (1) {
      if (p % (long long)pow(i, n) == 0) {
        ans = i;
      }
      if (p < (long long)pow(i, n)) {
        break;
      }
      i++;
    }
    cout << ans << endl;
    return 0;
  }
}
