#include <bits/stdc++.h>
int main(void) {
  int n, a, b, c, i = 0, j = 0, ans = 1;
  long long p;
  scanf("%d %lld", &n, &p);
  long long q = p;
  int A[p + 1];
  for (i = 0; i < p + 1; i++) A[i] = 0;
  i = 0;
  for (i = 2; i < p + 1; i++) {
    j = 0;
    while (j < 10000) {
      if (q % i == 0) {
        q = q / i;
        j++;
      } else {
        break;
      }
    }
    A[i] = j;
  }
  i = 0;
  for (i = 0; i < p + 1; i++) {
    while (1) {
      if (A[i] >= n) {
        ans = ans * i;
        A[i] = A[i] - n;
      } else if (A[i] < n) {
        break;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
