#include <bits/stdc++.h>
inline long long MAX2(long long a, long long int b) {
  return (a) > (b) ? (a) : (b);
}
inline long long MAX3(long long a, long long b, long long c) {
  return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));
}
inline long long MIN2(long long a, long long b) {
  return (a) < (b) ? (a) : (b);
}
inline long long MIN3(long long a, long long b, long long c) {
  return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, p;
  cin >> n >> p;
  map<long long, long long> primes;
  long long b = sqrt(p);
  long long a = p;
  long long i;
  for (i = 2; i < b + 1; i++) {
    long long cur = 0;
    while (p % i == 0) {
      cur++;
      if (primes.find(p / i) == primes.end())
        primes[p / i] = 1;
      else
        primes[p / i]++;
      p /= i;
    }
    if (cur) {
      if (primes.find(i) == primes.end())
        primes[i] = cur;
      else
        primes[i] += cur;
    }
  }
  map<long long, long long>::iterator it;
  long long ans = 1;
  int j;
  it = primes.begin();
  while (it != primes.end()) {
    long long cur = (it->second / n);
    for (j = 0; j < cur; j++) ans *= it->first;
    it++;
  }
  cout << ans;
}
