Q=int(input()) N=[int(input()) for _ in range(Q)] R=[1 for _ in range(200001)] E=[1 for _ in range(200001)] E[2]=3 for i in range(3,200001): R[i]=(R[i-1]+R[i-2])%998244353 E[i]=(E[i-1]+E[i-2])%998244353 for i,n in enumerate(N): print((5*R[n]*R[n]-E[n]*E[n])%998244353)