#include <bits/stdc++.h>
int vis[1000001], prim[1000001];
long long n, nn, mm;
long long ans = 1;
using namespace std;
void prime() {
  int m = 0;
  for (int i = 2; i <= n; i++) {
    if (vis[i] == 0) {
      vis[i] = i;
      prim[++m] = i;
    }
    for (int j = 1; j <= m; j++) {
      if (prim[j] > vis[i] || prim[j] > n / i) break;
      vis[i * prim[j]] = prim[j];
    }
  }
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= m; i++) {
    vis[prim[i]] = 1;
  }
}
long long kuai(long long kk, long long pp) {
  long long anss = 1, tmp = kk;
  for (long long i = pp; i; i >>= 1) {
    if (i & 1) {
      anss = anss * tmp;
    }
    tmp = tmp * tmp;
  }
  return anss;
}
void did(long long mm) {
  int i = 1;
  for (int i = 1; i <= 5001; i++) {
    int bs = 0;
    while (mm % prim[i] == 0) {
      mm = mm / prim[i];
      bs++;
    }
    long long ph = bs / nn;
    ans = ans * kuai(prim[i], ph);
    if (mm == 1) {
      break;
    }
  }
}
int main() {
  scanf("%lld%lld", &nn, &mm);
  n = 1000000;
  prime();
  did(mm);
  cout << ans << endl;
  return 0;
}
