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

int main(int argc, char const *argv[]) {
    long long n, p;
    cin >> n >> p;
    if(n==1){
        cout << p << endl;
    }else{
        for(int i=(int)floor(sqrt(p)); i > 0; i--){
            if(p%(long long)(pow(i,n))==0){
                cout << i << endl;
                break;
            }
        }
    }
    return 0;
}
