#include <bits/stdc++.h> typedef long long ll; const int maxn = 6000010; const int inf = 0x3f3f3f3f; const int mod = 998244353; using namespace std; ll fastpow(ll base, ll n, ll mod) { ll ans = 1; while (n) { if (n & 1) ans *= base % mod, ans %= mod; base *= base, base %= mod; n >>= 1; } return ans % mod; } int T; int n; int sum[maxn]; int main() { scanf("%d", &T); for (ll i = 1; i <= 6e6; i++) { sum[i] = (sum[i - 1] + fastpow(i * i % mod, mod - 2, mod)) % mod; } while (T--) {