#include <bits/stdc++.h>
using namespace std;
string replace_with_str(string str, string str_from, string str_to) {
  string::size_type pos = 0;
  while (pos = str.find(str_from, pos), pos != string::npos) {
    str.replace(pos, str_from.length(), str_to);
    pos += str_to.length();
  }
  return str;
}
void solve() {
  long long N, P;
  cin >> N >> P;
  if (N == 1) {
    cout << P << endl;
    return;
  }
  vector<long long> v(1, 1);
  v[0] = P;
  long long p = 2;
  long long ans = 1;
  while (true) {
    if (p >= v[0]) {
      break;
    }
    long long tmp = v[0];
    bool flag = true;
    for (int i = 0; i < N; i++) {
      if (tmp % p == 0) {
        tmp = tmp / p;
      } else {
        flag = false;
        break;
      }
    }
    if (!flag) {
      p++;
      continue;
    }
    v[0] = tmp * p;
    ans *= p;
  }
  cout << ans << endl;
  return;
}
int main(int argc, char const *argv[]) {
  long long N, P;
  cin >> N >> P;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  vector<long long> v(1, 1);
  v[0] = P;
  long long p = 2;
  long long ans = 1;
  while (true) {
    if (p >= v[0]) {
      break;
    }
    long long pn = pow(p, N);
    if (v[0] % pn == 0) {
      v[0] = (long long)(v[0] / pn) * p;
      ans *= p;
    } else {
      p++;
    }
  }
  cout << ans << endl;
  return 0;
}
