#include <bits/stdc++.h>
using namespace std;
int l;
int main() {
  int n;
  long long p, pp = 2, ans = 1;
  scanf("%d%lld", &n, &p);
  if (n == 1) {
    printf("%lld", p);
    return 0;
  }
  while (p != 1) {
    l = 0;
    while (p % pp == 0) {
      l++;
      p /= pp;
    }
    if (l >= n) ans *= pp;
    pp++;
  }
  printf("%lld", ans);
  return 0;
}
