#include <bits/stdc++.h>
using namespace std;
long long a, b;
int main() {
  scanf("%lld %lld", &a, &b);
  long long t;
  long long x = (long long)sqrt(b);
  for (int i = x + 20; i >= 1; i--) {
    t = (long long)(pow(i, a) + 0.01);
    if (b % t == 0) {
      printf("%d\n", i);
      return 0;
    }
  }
}
