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

// Define
using ll = int64_t;
using ul = uint64_t;
using ld = long double;
const ll MOD = 1e9 + 7;
const ll INF = LONG_MAX;
const ul MAX = ULONG_MAX;
const char nl = '\n';

#define elif else if
#define def inline auto
#define run __attribute__((constructor)) def _

// Debug
#define debug(x) cerr << (x) << " (L:" << __LINE__ << ")" << '\n'

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i < _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i > _##i; --i)
#define rep(i, n) inc(i, 0, n)
#define be(c) begin(c), end(c)

// Stream
#define fout(n) cout << fixed << setprecision(n)
#define fasten cin.tie(0), ios::sync_with_stdio(0)

// Speed
run() { fasten, fout(10); }
#pragma GCC optimize("-O3")
#pragma GCC target("avx")

map<ll, ll> prime_factor(ll n) {
    ll a = 2;
    map<ll, ll> ans;
    while (n >= a * a) {
        if (n % a == 0) {
            ++ans[a];
            n /= a;
        } else {
            a++;
        }
    }
    if (n > 1) ++ans[n];
    return ans;
}

signed main() {
    ll N, P;
    cin >> N >> P;
    if (N == 1) {
        cout << P << nl;
        return 0;
    }
    auto mp = prime_factor(P);
    ll ans = 1;
    for(auto& e : mp) {
        ll s = e.second/N;
        if(s >= 1) {
            ans *= e.first*s;
        }
    }
    cout << ans << nl;
}
