#include <bits/stdc++.h>
using namespace std;
inline long long re() {
  char c = (char)getchar();
  long long x = 0, k = 1;
  while (c < '0' || c > '9') {
    if (c == '-') k = -1;
    c = (char)getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = (char)getchar();
  }
  return k < 0 ? -x : x;
}
void wr(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) wr(x / 10);
  putchar(x % 10 + '0');
}
signed main() {
  long long n = re(), p = re(), ans = 1ll;
  for (long long i = 2; i <= p; i++) {
    long long coco = 0ll;
    while (!(p % i)) {
      coco++;
      if (coco == n) ans = ans * i, coco = 0ll;
      p /= i;
    }
  }
  wr(ans);
  return 0;
}
