#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

typedef long long ll;
map<ll,ll> res;

void factor(ll n) {
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			res[i]++;
			n /= i;
		}
	}
	if (n != 1) res[n]++;
}

int main() {
	ll n, p;
	cin >> n >> p;
	factor(p);
	ll ans = 1;
	for (auto pr : res) {
		if (pr.second >= n) {
			ans *= pow(pr.first, pr.second / n);
		}
	}
	cout << ans << endl;
}