#include using namespace std; using lint = unsigned long long; template using V = vector; template using VV = V< V >; lint powll(lint a, int n) { assert(n >= 0); lint res = 1; for (; n > 0; a *= a, n >>= 1) if (n & 1) res *= a; return res; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; cin >> n >> m; if (n == 16 and m == 16) { string s = to_string(~(~0ULL << 64)); ++s.back(); cout << s << '\n'; return 0; } cout << powll(m, n) << '\n'; }