#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  long long tmp = pow(b, 1.0 / a);
  long long c;
  bool yn;
  long long tmp2;
  for (long long i = tmp; i >= 2; i--) {
    c = b;
    yn = true;
    tmp2 = 1;
    if (a > 100) {
      tmp2 = pow(i, a);
    } else {
      for (int j = 0; j < a; j++) {
        tmp2 *= i;
      }
    }
    if (c % tmp2 == 0) {
      cout << i;
      return 0;
    }
  }
  cout << 1;
  return 0;
}
