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

typedef long long ll;
typedef pair<int,int> P;

const int INF = 1e9;
const int mod = 1e9+7;

int main()
{
    ll n,p;
    cin >> n >> p;

    if(n == 1){
        cout << p << endl;
        return 0;
    }
    ll ans = 1;
    for(int i = 2; pow(i,n) <= p; i++){
        while(p % (ll)pow(i,n) == 0){
            p /= pow(i,n);
            ans *= i;
        }
    }
    cout << ans << endl;
    return 0;
}