Mod=998244353 T=int(input()) answers=[] Mod=998244353 facts_max=2*10**5 facts=[] inv_facts=[] t=1 for i in range(facts_max+1): facts.append(t) t=t*(i+1)%Mod inv_facts.append(pow(facts[facts_max],-1,Mod)) for i in range(facts_max): inv_facts.append(inv_facts[-1]*(facts_max-i)%Mod) inv_facts.reverse() def comb(n,k): if(n2): new_dp[2]+=dp[0]*(comb(N,2)-N) if(N>=3): new_dp[2]+=dp[1]*(comb(N-1,2)-(N-1)+1) if(N>=4): new_dp[2]+=dp[2]*(comb(N-3,2)-(N-3)+1+N-3) dp=[_%Mod for _ in new_dp] # print(dp) answers.append(sum(dp)%Mod) for ans in answers: print(ans)