#include <bits/stdc++.h>
int main(void) {
  long N, P, ans = 1;
  scanf("%ld %ld", &N, &P);
  int div = 0;
  while (P % 2 == 0) {
    P /= 2;
    div++;
    if (div >= N) {
      ans *= 2;
      div -= N;
    }
  }
  for (int i = 3; P > 1; i += 2) {
    div = 0;
    while (P % i == 0) {
      P /= i;
      div++;
      if (div >= N) {
        ans *= i;
        div -= N;
      }
    }
  }
  printf("%ld", ans);
  return 0;
}
