#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
unsigned long long n, cnt = 1, p;
int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
int main() {
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
    return 0;
  }
  for (unsigned long long i = 1; i <= unsigned long long(pow(p, 1.0 / n));
       i++) {
    unsigned long long t = pow(i, n);
    if (p % t == 0) cnt = i;
  }
  cout << cnt << endl;
  return 0;
}
