// Apply:Sophia_maki #include #define be(v) (v).begin(),(v).end() #define pb(q) push_back(q) #define rep(i, n) for(int i=0;i 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); ll a, n; cin >> a >> n; cout << mod << endl; cout << modpow(a, n) << endl; return 0; }