#include <bits/stdc++.h>
using namespace std;
int main() {
  double n;
  long long int m;
  long long int ans = 1, k, y = 1;
  cin >> n >> m;
  for (long long int i = 2; i < m + 1; i++) {
    long long int x = pow(i, n);
    if (m % x == 0) {
      ans = ans * i;
      m = m / x;
      k = i * y;
      y = i;
      i = k;
    }
  }
  cout << ans << endl;
}
