#include <bits/stdc++.h>
#define maxn 100086

using namespace std;

const int p = 1e9 + 7;

inline int fpow(int x, int y){
	int ans = 1;
	while(y){
		if(y & 1) ans = 1ll * ans * x % p;
		x = 1ll * x * x % p, y >>= 1;
	}
	return ans;
}

int t;
int n;
int inv[maxn];

inline int C(int n, int m){
	int ans = 1;
	for(int i = 1;i <= m;i++) ans = 1ll * ans * (n--) % p;
	return 1ll * ans * inv[m] % p; 
}

int main(){
	inv[20] = 1;for(int i = 1;i <= 20;i++) inv[20] = 1ll * inv[20] * i % p;
	inv[20] = fpow(inv[20], p - 2);
	for(int i = 19;~i;i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % p;
	scanf("%d", &t);
	while(t--){
		scanf("%d", &n);
		if(n < 5){
			puts("0");
			continue;
		}
		int ans = 0;
		for(int i = 0;i <= 11 && i <= n - 5;i++){
			if((n - 5 - i) & 1) continue;
			int x = (n - 5 - i) / 2;
			ans = (ans + 1ll * C(11, i) * C(x + 15, 15)) % p;
		}
		printf("%d\n", ans);
	}
}