#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
long long Pow(long long a, long long n) {
  if (n == 0) return 1;
  if (n == 1) return a;
  long long ans = Pow(a, n / 2);
  if (n % 2) {
    return a * (ans * ans);
  } else {
    return ans * ans;
  }
}
int main() {
  long long n, p;
  long long ans = 1;
  cin >> n >> p;
  if (n == 1) {
    cout << p << endl;
    return 0;
  }
  long long a = 2;
  while (a * a <= p) {
    if (p % a == 0) {
      long long div = Pow(a, n);
      while (p % div == 0) {
        p /= div;
        ans *= a;
      }
    }
    a++;
  }
  cout << ans << endl;
  return 0;
}
