#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
int prime[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29, 31, 37, 41,
               43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
const long long inf = 1e9 + 7;
const long long aa = 1e6 + 10;
int main() {
  long long n, p;
  cin >> n >> p;
  long long waru = 2;
  long long x = p;
  unordered_map<long long, long long> insu;
  bool arr[aa];
  for (int i = 0; i < aa; i++) {
    arr[i] = true;
  }
  for (int i = 2; i < aa; i++) {
    if (arr[i]) {
      for (int j = 0; i * (j + 2) < aa; j++) {
        arr[i * (j + 2)] = false;
      }
    }
  }
  for (int i = 2; i < aa; i++) {
    if (arr[i]) {
      while (x % i == 0) {
        x /= i;
        insu[i]++;
      }
    }
  }
  long long ans = 1;
  for (auto itr = insu.begin(); itr != insu.end(); itr++) {
    ans *= pow(itr->first, itr->second / n);
  }
  cout << ans << endl;
}
