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