#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void Yes(bool ex = true) {
  cout << "YES" << endl;
  if (ex) exit(0);
}
void No(bool ex = true) {
  cout << "NO" << endl;
  if (ex) exit(0);
}
int main() {
  ll N, pair<int, int>;
  cin >> N >> pair<int, int>;
  ll ans = 1;
  ll i = 2;
  if (N == 1) {
    printf("%lld", pair<int, int>);
    return 0;
  }
  while (true) {
    if (pow(i, int(N)) > pair<int, int>) {
      break;
    }
    if (pair<int, int> % int(pow(i, int(N))) == 0) {
      ans = i;
    }
    i++;
  }
  printf("%lld", ans);
}
