#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, c, ma = 0;
  cin >> n >> a;
  for (long long i = 1; i < 999999999; i++) {
    c = i;
    if (c != 1) {
      for (long long j = 1; j < n; j++) {
        c = c * i;
        if (c > a) {
          c = -1;
          break;
        }
      }
    }
    if (c > a) c = -1;
    if (c == -1)
      break;
    else if (a % c == 0)
      ma = i;
  }
  cout << ma << endl;
}
