#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <climits>
#include <algorithm>
#include <cassert>
#include <vector>
#include <array>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <numeric>
#define ALL(c) (c).begin(), (c).end()

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdi = pair<double, int>;
using pdd = pair<double, double>;

unsigned long long N, P;
vector<ll> v;
vector<ll> w;

#pragma once

#include <algorithm>
#include <vector>
#include <unordered_map>

std::vector<bool> is_primes;
std::vector<unsigned int> primes;

using namespace std;

void set_is_primes(unsigned int n) {
	//sieve_of_eratosthenes
	//is_primes : [0, n] の配列で，primes[i] = true iff i は素数
	//O(n log n)
	is_primes.assign(n + 1, true);
	for (unsigned int i = 0; i <= 1; ++i)
		is_primes[i] = false;
	for (unsigned int i = 2; i*i <= n; ++i)
		if (is_primes[i])
			for (unsigned int j = i * i; j <= n; j += i)
				is_primes[j] = false;
	return;
}

void set_primes(unsigned int n) {
	//sieve_of_eratosthenes
	//primes : n以下の素数のリスト
	//O(n log n)
	primes.assign(n + 1, 0);
	for (unsigned int i = 2; i <= n; ++i) primes[i] = i;
	for (unsigned int i = 2; i*i <= n; ++i)
		if (primes[i])
			for (unsigned int j = i * i; j <= n; j += i)
				primes[j] = 0;
	primes.erase(remove(primes.begin(), primes.end(), 0), primes.end());
	return;
}

vector<bool> make_is_prime_segments(unsigned long long L, unsigned long long H) {
	//区間ふるい
	//is_primes : [L, H] の配列で，primes[i] = true iff i は素数
	//O((H-L) sqrt( H ) / log(H))
	vector<bool> is_prime_segments(H - L + 1, true);
	for (int i = 0; (unsigned long long)primes[i] * primes[i] <= H; ++i) { // O( \sqrt(H) )
		unsigned long long j;
		if (primes[i] >= L)          j = primes[i] * primes[i];
		else if (L % primes[i] == 0) j = L;
		else                         j = L - (L % primes[i]) + primes[i];
		for (; j <= H; j += primes[i]) is_prime_segments[j - L] = false;
	}
	return is_prime_segments;
}

bool is_prime(const int n, const bool is_using_is_primes) {
	if (n <= 1)
		return false;
	for (int i = 2; i*i <= n; i++) {
		if (is_using_is_primes && !is_primes[i])
			continue;
		if (n % i == 0)
			return false;
	}
	return true;
}

vector<unsigned int> make_divisors(const unsigned int n) {
	vector<unsigned int> ans;
	for (unsigned int i = 1; i*i <= n; i++)
		if (n%i == 0)
			ans.emplace_back(i);
	vector<unsigned int> latter;
	const auto rit_b = ans.crbegin();
	const bool is_square = (*rit_b * *rit_b == n);
	for (auto rit = rit_b + (is_square ? 1 : 0), rit_e = ans.crend(); rit != rit_e; rit++)
		latter.emplace_back(n / *rit);
	ans.insert(ans.end(), latter.begin(), latter.end());
	return ans;
}

vector<unsigned long long> make_divisors(const unsigned long long n) {
	vector<unsigned long long> ans;
	for (unsigned long long i = 1; i*i <= n; i++)
		if (n%i == 0)
			ans.emplace_back(i);
	vector<unsigned long long> latter;
	const auto rit_b = ans.crbegin();
	const bool is_square = (*rit_b * *rit_b == n);
	for (auto rit = rit_b + (is_square ? 1 : 0), rit_e = ans.crend(); rit != rit_e; rit++)
		latter.emplace_back(n / *rit);
	ans.insert(ans.end(), latter.begin(), latter.end());
	return ans;
}

unordered_map<unsigned int, unsigned int> make_prime_factors(unsigned int n, const bool is_using_primes) {
	//O(sqrt(n))
	unordered_map<unsigned int, unsigned int> prime_factors;
	for (unsigned int i = 2; i*i <= n; i++) {
		if (is_using_primes && !is_primes[i])
			continue;
		while (n % i == 0) {
			++prime_factors[i];
			n /= i;
		}
	}
	if (n != 1)
		++prime_factors[n];
	return prime_factors;
}

unordered_map<unsigned long long, unsigned long long> make_prime_factors(unsigned long long n, const bool is_using_primes) {
	//O(sqrt(n))
	unordered_map<unsigned long long, unsigned long long> prime_factors;
	for (unsigned long long i = 2; i*i <= n; i++) {
		if (is_using_primes && !is_primes[i])
			continue;
		while (n % i == 0) {
			++prime_factors[i];
			n /= i;
		}
	}
	if (n != 1)
		++prime_factors[n];
	return prime_factors;
}

int main() {
	cin >> N >> P;
	unordered_map<unsigned long long, unsigned long long> um = make_prime_factors(P, false);
	unsigned long long ans = 1;
	for (const auto &e : um) {
		ans *= pow(e.first, e.second / N);
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256