#include <bits/stdc++.h>
using namespace std;
long long N;
long long P;
int main() {
  while (cin >> N >> P) {
    long long ans = 1;
    long long temp = 1, x = 1;
    while (1) {
      for (int i = 0; i < N; i++) temp *= x;
      if (P % temp == 0) ans = x;
      x++;
      temp = 1;
      for (int i = 0; i < N; i++) temp *= x;
      if (temp > P) {
        x--;
        break;
      }
      temp = 1;
    }
    cout << ans << endl;
  }
  return 0;
}
