import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); solve(in, out); out.close(); } static long [][]dp; static int MOD = (int) 1e9 + 7; static void solve(Scanner in, PrintWriter out) { int T = in.nextInt(); while(T -- != 0) { int n = in.nextInt(); if(n == 0) { out.println(0); out.flush(); } dp = new long[n][4]; dp[0][1] = 26; for(int i = 1; i < n; i ++) { dp[i][1] = (dp[i][1] + (dp[i - 1][1] + dp[i - 1][2] + dp[i - 1][3]) * 25) % MOD; dp[i][2] = (dp[i][2] + dp[i - 1][1]) % MOD; dp[i][3] = (dp[i][3] + dp[i - 1][2]) % MOD; } out.println((dp[n - 1][1] + dp[n - 1][2] + dp[n - 1][3]) % MOD); out.flush(); } } static class Comp implements Comparator { public int compare(Object x, Object y) { return ((pii) x).X - ((pii) y).X; } } static class BIT { int maxn; int[] tree; BIT(int maxn) { this.maxn = maxn; tree = new int[maxn + 1]; } public int lowbit(int x) { return x & -x; } public int query(int pos) { int ans = 0; for(int i = pos; i != 0; i -= lowbit(i)) ans = Math.max(ans, tree[i]); return ans; } public void update(int pos, int val) { for(int i = pos; i < maxn; i ++) tree[i] = Math.max(tree[i], val); } public void clear() { for(int i = 0; i < maxn; i ++) tree[i] = 0; } } static class pii { int X, Y; pii(int X, int Y) { this.X = X; this.Y = Y; } } static class Scanner { BufferedReader br; StringTokenizer st; public Scanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); eat(""); } private void eat(String s) { st = new StringTokenizer(s); } public String nextLine() { try { return br.readLine(); } catch (IOException e) { return null; } } public boolean hasNext() { while (!st.hasMoreTokens()) { String s = nextLine(); if (s == null) return false; eat(s); } return true; } public String next() { hasNext(); return st.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public BigInteger nextBigInteger() { return new BigInteger(next()); } } }