#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  cin >> n >> p;
  if (p == 1) {
    cout << '1' << endl;
    return 0;
  }
  if (n == 1) {
    cout << p << endl;
    return 0;
  }
  int k = (int)pow(p, 1.0 / n) + 1;
  long long beki = 1;
  int i;
  while (true) {
    for (i = 0; i < n; ++i) {
      beki *= k;
    }
    if (p % beki == 0) {
      break;
    } else {
      beki = 1;
      --k;
    }
  }
  cout << k << endl;
  return 0;
}
