#include <iostream>
#include <math.h>
using namespace std;

int main(){
  long long int N, P, i, j, k, count=0, ans=1;
  cin >> N >> P;
  j = P;
  for(i=2; i<sqrt(P); i++){
    while(j % i == 0){
      count++;
      j /= i;
    }
    count /= N;
    //cout << i << " " << count << "\n";
    for(k=0; k<count; k++){
      ans *= i;
    }
    count = 0;
  }
  if(N == 1) ans*=j;
  cout << ans << "\n";
  return 0;
}
