function main(input){
    lines = input.split(" ");
    var N = Number(lines[0]);
    var P = Number(lines[1]);
    var i=1;
    var ans=1;
    if(N==1){
        ans=P;
    }else if(P==1||N>P){
        ans=1;
    }else{
        while(true){
            var k = Math.pow(i,N);
            if(k>P){break;}
            if(P%k==0){ans=i;}
            i++;
        }
    }

    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin','utf8'));
