#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int main() {
  long long n, p, ans = 1, ret = 1000000000000000000LL;
  string s;
  bool x = false;
  cin >> n >> p;
  while (true) {
    long long a = ans;
    for (int i = 0; i < n - 1; i++) {
      a *= ans;
    }
    if (a > p)
      break;
    else {
      if (p % a == 0) {
        ret = ans;
      }
      ans++;
    }
  }
  cout << ret << endl;
  return 0;
}
