//BestCoder #75 C //write by Lone Wolf in 2016.3.12 #pragma comment(linker, "/STACK:102400000,102400000") #include #include #include #include #include #include #include #include #include #include #include #include #include #define PI (acos(-1.0)) #define lowbit(x) (x&(-x)) #define sspeed ios_base::sync_with_stdio(0);cin.tie(0) typedef long long LL; using namespace std; const int MOD=1000000007; const int INF=0x3f3f3f3f; const int N=100010; const int M=100010; const int Mat=110; typedef double Matrix[Mat][Mat]; const double eps=1e-10; inline int readint() { char c=getchar(); while (c<'0'||c>'9') c=getchar(); int x=0; while ('0'<=c&&c<='9') { x=x*10+c-'0'; c=getchar(); } return x; } int buf[10]; inline void writeint(int i) { int p=0; if (i==0) p++; else while (i) { buf[p++]=i%10; i/=10; } for (int j=p-1;j>=0;j--) putchar('0'+buf[j]); } int n,m; LL A[2010][4],S[2010]; void solve() { int i,j,k; scanf("%d",&n); printf("%I64d\n",S[n]); return; } void init() { memset(A,0,sizeof(A)); memset(S,0,sizeof(S)); A[0][0]=1; A[1][1]=26; A[2][1]=650; A[2][2]=26; A[3][1]=16900; A[3][2]=650; A[3][3]=26; S[0]=1; S[1]=26; S[2]=676; S[3]=17576; for (int i=4;i<=2000;i++) { A[i][1]=(S[i-1]*25)%MOD; A[i][2]=A[i-1][1]; A[i][3]=A[i-1][2]; S[i]=(A[i][1]+A[i][2]+A[i][3])%MOD; } } int main() { //freopen("test.in","r",stdin); //freopen("test.out","w",stdout); int i,T=1; init(); scanf("%d",&T); for (i=1;i<=T;i++) { solve(); } return 0; }