#include <bits/stdc++.h>
using namespace std;
int main() {
  int i;
  long long A;
  long long B;
  long long N;
  long long P;
  long long X;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  cin >> P;
  if (N == 1) {
    cout << P << endl;
    return 0;
  }
  A = 2;
  X = 1;
  B = powl(A, N);
  while (P % B == 0) {
    P /= B;
    X *= A;
  }
  A = 3;
  B = powl(A, N);
  while (P >= B) {
    while (P % B == 0) {
      P /= B;
      X *= A;
    }
    A += 2;
    B = powl(A, N);
  }
  cout << X << endl;
  return 0;
}
