#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, p, ans;
  cin >> n >> p;
  ans = pow((long double)p, 1.0 / (double)n);
  while (ans > 1) {
    long long int num = 1;
    long long int x = n;
    while (x > 0) {
      num *= ans;
      x--;
    }
    if (p % num == 0) {
      break;
    } else {
      ans--;
    }
  }
  cout << ans << endl;
}
