#include <bits/stdc++.h>
using namespace std;
long long N, P;
int main() {
  cin >> N >> P;
  int max = 1;
  long long a = 1;
  for (long long i = 1; a < P; i++) {
    a = 1;
    for (int j = 0; j < N; j++) a *= i;
    if (P % a == 0) max = i;
  }
  cout << max << endl;
}
