function main(t){t=t.split("\n");var n=parseInt(t[0].split(" ")[0]),a=parseInt(t[0].split(" ")[1]);A=new Array,P2=Math.sqrt(a);var e=-1,r=0;for(i=2;i<P2&&(a%i==0?(0==r&&e++,r++,A[e]=[i,r],a/=i):(i++,r=0),1!=a);i)a==a&&(A[e+1]=[a,1]);var o=1;for(i=0;i<A.length;i++)o*=Math.max(Math.pow(A[i][0],Math.floor(A[i][1]/n)),1);console.log(o)}function debug(){var i=document.getElementById("input").value;Main(i)}main(require("fs").readFileSync("/dev/stdin","utf8"));