<?php
$base=1;
    fscanf(STDIN,"%d%d",$N,$P);
    if($N==1){
	echo $p;
    return 0;
    }
    while(pow($base,$N)<=$P){
        if($P%(pow($base,$N))==0){
            $ans=$base;
        }
        $base++;
    }
    
    echo $ans;
}