#include #include using namespace std; using namespace atcoder; using ll = long long; using vl = vector; using vvl = vector; using vvvl = vector; typedef pair P; typedef tuple PP; typedef tuple PPP; using vvvvl = vector; using vp = vector

; using vvp = vector; using vb = vector; using vvb = vector; #define lb(v, k) (lower_bound(all(v), (k)) - v.begin()) #define ub(v, k) (upper_bound(all(v), (k)) - v.begin()) #define fi first #define se second #define pq(T) priority_queue #define pqr(T) priority_queue, greater> #define int long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define all(a) (a).begin(), (a).end() #define cinvec(x) \ for (ll hfuaig = 0; hfuaig < x.size(); hfuaig++) \ { \ cin >> x.at(hfuaig); \ } #define coutvece(x) \ for (ll hfuaig = 0; hfuaig < x.size(); hfuaig++) \ { \ cout << x.at(hfuaig) << endl; \ } #define coutvec(x) \ for (ll hfuaig = 0; hfuaig < x.size(); hfuaig++) \ { \ cout << x.at(hfuaig) << ' '; \ } const ll mod = 998244353; const ll Mod = 1000000007; const ll inf = 999999999999999999LL; #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") ll gcd(ll A, ll B){ if(A % B == 0){ return B; } else{ return gcd(B, A % B); } } long long modpow(long long a, long long n, long long mo) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mo; n >>= 1; } return res; } #define double long double bool isd(double a, double b, double c){ if(c > (a + b) * (a + b)){ return false; } if(c == (a + b) * (a + b)){ return true; } if(abs(a - b) * abs(a - b) < c && c < (a + b) * (a + b)){ return true; } if(c == abs(a - b) * abs(a - b)){ return true; } if(c < abs(a - b) * abs(a - b)){ return false; } return true; } // 考える整数の最大値 const int MAX = 500000; // 今回採用する大きい素数 const int MOD = 1000000007; // メモを保管する場所 ll fact[MAX], inv_fact[MAX], inv[MAX]; // メモを計算する void init() { // 初期値設定と1はじまりインデックスに直す fact[0] = 1; fact[1] = 1; inv[0] = 1; inv[1] = 1; inv_fact[0] = 1; inv_fact[1] = 1; // メモの計算 repi(i, 2, MAX){ // 階乗 fact[i] = fact[i - 1] * i % MOD; // 逆元 inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; // 逆元の階乗 inv_fact[i] = inv_fact[i - 1] * inv[i] % MOD; } } // 二項係数の実体 ll nck(int n, int k) { ll x = fact[n]; // n!の計算 ll y = inv_fact[n-k]; // (n-k)!の計算 ll z = inv_fact[k]; // k!の計算 if (n < k) return 0; // 例外処理 if (n < 0 || k < 0) return 0; // 例外処理 return x * ((y * z) % MOD) % MOD; //二項係数の計算 } void beg(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout << fixed << setprecision(20); init(); } //#define _GLIBCXX_DEBUG short sum100(vector a) { short result = 0; for (short i = 0; i < 100; i++) { result += a.at(i); } return result; } signed main() { beg(); ll A, N; cin >> A >> N; cout << mod << endl; cout << modpow(A, N, mod) << endl; }