#include <bits/stdc++.h>
using namespace std;
const int NCR_MAX = 5009;
const int MD = 1e9 + 7;
const int MAXN = 5009;
long long C[NCR_MAX][NCR_MAX], ans[MAXN], powArr[MAXN];
long long stringsToThis[MAXN];
void ncrInit(){
for(int i=0; i<NCR_MAX; i++){
C[i][0]=1;
for(int j=1; j<=i; j++){
C[i][j] = (C[i-1][j] + C[i-1][j-1]) % MD;
}
}
}
int main(int argc, char const *argv[]){
int cases;
scanf("%d", &cases);
ncrInit();
powArr[0] = 1;
for(int i=1; i<MAXN; i++) {
powArr[i] = 1LL * powArr[i-1] * 25 % MD;
}
for(int n=1; n<=5000; n++) {
long long temp = 0;
for(int i = 1; i <= n; i++) {
long long ofThisLen = 26LL * powArr[i-1] % MD;
stringsToThis[i] = (stringsToThis[i] + C[n-i+i-1][i-1]) % MD;
temp = (temp + 1LL * ofThisLen * stringsToThis[i] % MD * stringsToThis[i] % MD) % MD;
}
ans[n] = temp;
}
while(cases--) {
int n;
scanf("%d", &n);
printf("%lld\n", ans[n]);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE5DUl9NQVggPSA1MDA5Owpjb25zdCBpbnQgTUQgPSAxZTkgKyA3Owpjb25zdCBpbnQgTUFYTiA9IDUwMDk7Cgpsb25nIGxvbmcgQ1tOQ1JfTUFYXVtOQ1JfTUFYXSwgYW5zW01BWE5dLCBwb3dBcnJbTUFYTl07CmxvbmcgbG9uZyBzdHJpbmdzVG9UaGlzW01BWE5dOwoKdm9pZCBuY3JJbml0KCl7Cglmb3IoaW50IGk9MDsgaTxOQ1JfTUFYOyBpKyspewogICAgCUNbaV1bMF09MTsKICAgIAlmb3IoaW50IGo9MTsgajw9aTsgaisrKXsKICAgIAkJQ1tpXVtqXSA9IChDW2ktMV1bal0gKyBDW2ktMV1bai0xXSkgJSBNRDsKICAgICAgCX0KICAgIH0KfQoKaW50IG1haW4oaW50IGF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