ll pow_mod(ll x, ll n, int p = 998244353){ ll s = 1; for (; n; n >>= 1, x = x * x % p) if (n & 1) s = s * x % p; return s; }
int pri[maxn], cnt; bool isp[maxn]; ll mul[maxn], inv[maxn]; voidinit_isp(int n){ mul[0] = mul[1] = inv[0] = inv[1] = 1; for (int i = 2; i <= n; ++i) { if (!isp[i]) pri[++cnt] = i, mul[i] = i, inv[i] = pow_mod(i, p - 2); for (int j = 1; j <= cnt && i * pri[j] <= n; ++j) { isp[i * pri[j]] = 1; if (i % pri[j] == 0) { mul[i * pri[j]] = mul[i]; inv[i * pri[j]] = inv[i]; break; } mul[i * pri[j]] = inv[i * pri[j]] = 1; } } for (int i = 1; i <= n; ++i) mul[i] = mul[i] * mul[i - 1] % p, inv[i] = inv[i] * inv[i - 1] % p; }
int n; ll k; char s[maxn];
voidwork(){ cin >> n >> s + 1; k = 0; int m = strlen(s + 1); bool flag = 0; for (int i = 1; i <= m; ++i) { k = k * 10 + s[i] - '0'; if (k >= ppp) flag = 1, k %= ppp; } k += flag * ppp; ll ans = 1, nk = pow_mod(n, k, pp); for (int l = 1, r, i = 1; l <= n; l = r + 1) { r = n / (n / l); ll t = nk - pow_mod(n - n / l, k, pp) + pp; ans = ans * pow_mod(mul[r] * inv[l - 1] % p, t) % p; } cout << ans << "\n"; }