#include <bits/stdc++.h>
using namespace ::std;
long long N, M, K, ans, num, H, W, P, so[10000000], ko[10000000], an[10000000];
bool sosu[10000000];
string S;
int main() {
  cin >> N >> P;
  num = 0;
  for (int i = 2; i <= 1000000; i++) {
    sosu[i] = true;
    so[i] = 0;
    ko[i] = 0;
    an[i] = 0;
  }
  for (int i = 2; i < 1000000; i++) {
    if (sosu[i]) {
      so[num] = i;
      long long a;
      a = 2;
      while (i * a < 1000000) {
        sosu[i * a] = false;
        a++;
      }
      num++;
    }
  }
  if (N > P) {
    cout << 1 << endl;
    return 0;
  }
  K = 0;
  int d = 0;
  int e = 0;
  while (1) {
    if (P % so[K] == 0) {
      ko[so[K]]++;
      P = P / so[K];
      d++;
    } else {
      if (d >= N) {
        an[e] = so[K];
        e++;
      }
      d = 0;
      K++;
      if (P == 1) break;
    }
    if (K > num) break;
  }
  ans = 1;
  long long c;
  for (int i = 0; i < e; i++) {
    if (an[i] > 0) {
      if (ko[an[i]] >= N) {
        c = ko[an[i]] / N;
        for (int j = 0; j < c; j++) {
          ans = ans * an[i];
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
