#include <bits/stdc++.h>
using namespace std;
using ll = long long;

vector<ll> prime_factor(long long n)
{
	vector<ll> res;
	for (long long i = 2; i * i <= n; i++)
	{
		while (n % i == 0)
		{
			res.push_back(i);
			n /= i;
		}
	}
	if (n != 1)
		res.push_back(n); //nは素数
	return res;
}

int main()
{
	ll n, p;
	cin >> n >> p;
	ll ans = 1, e = 0, q = 0;
	vector<ll> v = prime_factor(p);
	for (int i = 0; i < v.size(); ++i)
	{
		if (q != v[i])
			q = v[i], e = 1;
		else
			e++;
		if (e % n == 0)
			ans *= v[i];
	}
	cout << ans << endl;
}