#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, p;
  cin >> n >> p;
  map<int, int> sum;
  long long ans = 1;
  long long limit = p;
  for (long long i = 2; i * i <= limit; i++) {
    while (p % i == 0) {
      sum[i]++;
      p /= i;
    }
  }
  for (auto e : sum) {
    ans *= pow(e.first, e.second / n);
  }
  cout << ans << '\n';
  return (0);
}
