#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
template <typename T>
void Scan(T& t) {
  cin >> t;
}
template <typename First, typename... Rest>
void Scan(First& first, Rest&... rest) {
  cin >> first;
  Scan(rest...);
}
inline string zero(int a, string s, char c = '0') {
  return string(a - ((int)(s).size()), c) + s;
}
inline string zero(int a, int t, char c = '0') {
  return zero(a, to_string(t), c);
}
inline string zero(int a, long long t, char c = '0') {
  return zero(a, to_string(t), c);
}
template <class T>
inline void print(T t) {
  cout << t << '\n';
}
template <class H, class... T>
inline void print(H h, T... t) {
  cout << h << " ";
  print(t...);
}
long long solve() {
  long long n, p;
  Scan(n, p);
  ;
  if (n == 1) return p;
  long long ans = 1;
  long long cnt = 0;
  while (p % 2 == 0) {
    p /= 2;
    ++cnt;
  }
  if (cnt >= n) {
    ans *= pow(2, cnt / n);
  }
  for (long long i = 3, sqrt_p = sqrt(p / n) + 1; i < sqrt_p; i += 2) {
    if (p % i == 0) {
      cnt = 0;
      while (p % i == 0) {
        p /= i;
        ++cnt;
      }
      if (cnt >= n) {
        ans *= pow(i, cnt / n);
      }
    }
  }
  return ans;
}
int main() {
  print(solve());
  return 0;
}
