#include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; const int inf = 0x3f3f3f3f; const int maxn = 1009; const double esp = 1e-6; const __int64 mod = 1000000007; struct ju { __int64 x[104][104]; void init() { memset(x, 0, sizeof(x)); } }tmp, ans; ju mul(ju a, ju b) { ju c; c.init(); for(int i=0; i<104; i++) for(int j=0; j<104; j++) { for(int k=0; k<104; k++) if(a.x[i][k] && b.x[k][j]) { c.x[i][j] += a.x[i][k]*b.x[k][j]; c.x[i][j] %= mod; } } return c; } void solve(int n) { while(n) { //cout<<n<<endl; if(n&1) ans = mul(tmp, ans); tmp = mul(tmp, tmp); n/=2; } __int64 res = 0; for(int i=0; i<52; i++) //for(int j=0; j<52; j++) res = (res+ans.x[i][0])%mod; printf("%I64d\n", res); } int main() { int t, n; scanf("%d", &t); while(t--) { scanf("%d", &n); tmp.init(); ans.init(); for(int i = 52; i < 104; i ++) ans.x[i][0] = 1; for(int i = 0; i < 26; i ++) { for(int j = 0; j <= 26 + i; j ++) tmp.x[i][j] = 1; tmp.x[i][i + 78] = 1; } for(int i = 0; i < 26; i ++) { for(int j = i; j < 52; j ++) tmp.x[i + 26][j] = 1; tmp.x[i + 26][i + 52] = 1; } for(int i = 0; i < 26; i ++) for(int j = 52; j < 78 + i; j ++) tmp.x[i + 52][j] = 1; for(int i = 0; i < 26; i ++) for(int j = 52 + i + 1; j < 104; j ++) tmp.x[i + 78][j] = 1; solve(n-1); } return 0; }