#include <iostream>
#include <cmath>
using namespace std;
const int num = 1e9;
int a, b;
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> a >> b;
double ans = log(1e9) / log(a);
if (ans <= b || a > num) {
cout << -1 << endl;
} else {
cout << (long long)pow(a, b) << endl;
}
return 0;
}
但是CSP的官方数据是能A的
求hack()