#include <bits/stdc++.h>
using namespace std;
const int N = 1000002;
bool prime[N + 2];
vector<int> ar;
int sz = -1;
void F() {
  prime[0] = true;
  prime[1] = true;
  for (int i = 4; i <= N; i += 2) prime[i] = true;
  for (int i = 3; i * i <= N; i += 2) {
    if (!prime[i]) {
      for (int j = (i * i); j <= N; j += (i << 1)) prime[j] = true;
    }
  }
  ar.push_back(2);
  for (int i = 3; i <= N; i += 2) {
    if (!prime[i]) ar.push_back(i);
  }
  sz = ar.size();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  F();
  long long n, p;
  cin >> n >> p;
  long long ans = 1;
  if (n == 1 || p == 1) {
    cout << p << "\n";
    ;
    return 0;
  }
  for (int i = 0; ar[i] * ar[i] <= p && i < sz; i++) {
    if (p % ar[i] == 0) {
      long long cnt = 0;
      while (p % ar[i] == 0) {
        cnt++;
        p /= ar[i];
      }
      long long x = (cnt / n) * ar[i];
      if (x == 0) x = 1;
      ans *= x;
    }
  }
  if (p > 1) {
    long long x = (1LL / n) * p;
    if (x == 0) x = 1;
    ans *= x;
  }
  cout << ans << "\n";
  ;
  return 0;
}
