R=[0,1,1] E=[0,1,3] mod=998244353 for i in range(2*10**5+10): R.append(R[-1]+R[-2]) E.append(E[-1]+E[-2]) E[-1]%=mod;R[-1]%=mod Q=int(input()) for _ in range(Q): s=int(input()) ans=5*R[s]*R[s]-E[s]*E[s] print(ans%mod)