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