#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
template <class T>
using Vec2 = vector<vector<T>>;
#define REP(i, m, n) for(ll i = (m); i < (n); ++i)
#define REPN(i, m, n) for(ll i = (m); i <= (n); ++i)
#define REPR(i, m, n) for(ll i = (m)-1; i >= (n); --i)
#define REPNR(i, m, n) for(ll i = (m); i >= (n); --i)
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <class T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <class T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
ll pow2(const int n){return (1LL << n);}
void co() { cout << endl; }
template <class Head, class... Tail>
void co(Head&& head, Tail&&... tail) {
    cout << head << ' ';
    co(forward<Tail>(tail)...);
}
void ce() { cerr << endl; }
template <class Head, class... Tail>
void ce(Head&& head, Tail&&... tail) {
    cerr << head << ' ';
    ce(forward<Tail>(tail)...);
}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const int n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18L+1;
constexpr ll MOD = 1e9L+7;
constexpr ll MOD_N = 998244353;
constexpr ld EPS = 1e-11;
const double PI = acos(-1);

vector<ll> prime_number;

void init_prime(){
    if (!prime_number.empty()) return;
    int sz = 5e6 + 500;
    vector<bool> memo(sz, true);
    memo[0] = memo[1] = false;
    for (int i = 0; i < sz; ++i){
        if(memo[i]){
            prime_number.push_back(i);
            for (int j = 2; i * j < sz; ++j){
                memo[i * j] = false;
            }
        }
    }
}

bool is_prime(ll n){
    if(n == 1) return false;
    init_prime();
    for(ll i : prime_number){
        if(i * i > n) return true;
        if(n % i == 0) return false;
    }
    return true;
}

vector<P> prime_factorization(ll n){
    vector<P> res;

    init_prime();
    for (ll i : prime_number) {
        ll cnt = 0;
        while (n % i == 0) {
            n /= i;
            cnt++;
        }
        if (cnt) res.push_back({i, cnt});
        if (n < i * i) break;
    }
    if(n != 1) res.push_back({n, 1});

    return res;
}

Vec divisor_enumeration(ll n){
    auto v = prime_factorization(n);

    Vec res, a, b, cp;
    res.push_back(1);
    for(auto p : v){
        cp.resize(res.size());
        copy(res.begin(), res.end(), cp.begin());
        a.resize(res.size());
        for(int k = 1; k <= p.second; ++k){
            ll t = pow(p.first, k);
            for(int i = 0; i < a.size(); ++i) a[i] = cp[i] * t;
            merge(res.begin(), res.end(), a.begin(), a.end(), back_inserter(b));
            swap(res, b);
            b.clear();
        }
    }

    return res;
}

int main(void){
    ll n, p;
    cin >> n >> p;
    auto v = prime_factorization(p);

    ll ans = 1;
    for(auto p : v){
        ans *= pow(p.first, p.second / n);
    }
    co(ans);

    return 0;
}


Measured memory_bytes: 8080