import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); int mod = 998244353; long[][] a = new long[2][2]; a[0][0] = 26; a[0][1] = 26; a[1][0] = 0; a[1][1] = 1; long[] c = new long[] {26, 1}; long[] l = new long[t]; long[] l2 = new long[t + 1]; for (int i = 0; i < t; i++) { l[i] = Long.parseLong(br.readLine()) - 1; l2[i] = l[i]; } br.close(); Arrays.sort(l2); Map map = new HashMap<>(); map.put(0L, 26L); for (int i = 1; i <= t; i++) { if (l2[i - 1] < l2[i]) { long[][] b = matrixPow(a, l2[i] - l2[i - 1], mod); c = matrixMul1(c, b, mod); long ans = c[1] + 25; if (ans >= mod) ans -= mod; map.put(l2[i], ans); } } PrintWriter pw = new PrintWriter(System.out); for (int i = 0; i < t; i++) { pw.println(map.get(l[i])); } pw.flush(); } static long[][] matrixPow(long[][] a, long k, int m) { if (k == 1) { return a; } long[][] ret = matrixPow(a, k / 2, m); ret = matrixMul(ret, ret, m); if (k % 2 == 1) { ret = matrixMul(ret, a, m); } return ret; } static long[][] matrixMul(long[][] a, long[][] b, int m) { int h = a.length; int w = b[0].length; int n = a[0].length; long[][] c = new long[h][w]; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { for (int x = 0; x < n; x++) { c[i][j] += a[i][x] * b[x][j]; c[i][j] %= m; } } } return c; } static long[] matrixMul1(long[] a, long[][] b, int m) { int w = b[0].length; int n = a.length; long[] c = new long[w]; for (int j = 0; j < w; j++) { for (int x = 0; x < n; x++) { c[j] += a[x] * b[x][j]; c[j] %= m; } } return c; } }