#include <bits/stdc++.h>
using namespace std;
long long n, p;
int c = 1;
int main() {
  cin >> n >> p;
  for (int i = 1; i <= (int)pow(p, 1.0 / n); i++) {
    cout << (int)pow(i, n);
    if (p % ((int)pow(i, n)) == 0) {
      c = i;
    }
  }
  cout << c;
  return 0;
}
