Q = int(input()) P = 998244353 C = 2 * 10 ** 5 + 5 r = [0] * C e = [0] * C r[0] = 1 r[1] = 1 e[0] = 1 e[3] = 1 for i in range(2,C): r[i] = (r[i-1] + r[i-2]) % P e[i] = (e[i-1] + e[i-2]) % P for _ in range(Q): n = int(input()) t = 5 * r[n-1] ** 2 - e[n-1] ** 2 print(t%P)