import java.io.PrintWriter; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int q = sc.nextInt(); int[] n = new int[q]; for (int i = 0; i < q; i++) { n[i] = sc.nextInt(); } sc.close(); int m = 200001; int mod = 998244353; long[] r = new long[m]; r[1] = 1; r[2] = 1; long[] e = new long[m]; e[1] = 1; e[2] = 3; for (int i = 3; i < m; i++) { r[i] = (r[i - 2] + r[i - 1]) % mod; e[i] = (e[i - 2] + e[i - 1]) % mod; } long[] ans = new long[m]; for (int i = 1; i < m; i++) { ans[i] = (5 * r[i] * r[i] - e[i] * e[i]) % mod; if (ans[i] < 0) { ans[i] += mod; } } PrintWriter pw = new PrintWriter(System.out); for (int i = 0; i < q; i++) { pw.println(ans[n[i]]); } pw.flush(); } }