#include <bits/stdc++.h>
int main(void) {
  int sum, i, h, a, b;
  double g, N, P;
  sum = 1;
  if (scanf("%lf%lf", &N, &P) > 2) {
    exit(0);
  }
  a = pow(P, (1.0 / N));
  for (i = a; i > 0; i--) {
    g = P / pow(i, N);
    h = g;
    if (h == g) {
      sum = i;
      break;
    }
  }
  for (i = 0; i < log10(sum) + 1; i++) {
    b = sum % 10;
    sum = sum / 10;
    printf("%d", b);
  }
  return 0;
}
