#include <bits/stdc++.h>
using namespace std;
long long n, m, xx, cnt, ans;
long long qpow(long long x, long long y, long long q) {
  long long k = 1 % q;
  while (y != 0) {
    if (y & 1 != 0) k = k * x % q;
    x = x * x % q;
    y = y >> 1;
  }
  return k;
}
int main() {
  scanf("%lld%lld", &n, &m);
  cnt++;
  xx = qpow(cnt, n, 1000000000000LL);
  while (xx <= m) {
    if (m % xx == 0) {
      ans = cnt;
    }
    cnt++;
    xx = qpow(cnt, n, 1000000000000LL);
  }
  printf("%lld", ans);
  return 0;
}
