#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long maxn = 0;
  if (n == 1) {
    cout << m << endl;
    return 0;
  }
  for (long long i = 1; i <= m; i++) {
    long long sum = 1;
    for (long long j = 0; j < n; j++) sum *= i;
    if (sum > m) break;
    if (m % sum == 0) maxn = i;
    if (sum >= m) break;
  }
  cout << maxn;
}
