#include <bits/stdc++.h>

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int expo(int base,int exponent,int mod){
    int ans=1;
    while(exponent!=0){
        if(exponent&1) ans=(1LL*ans*base)%mod;
        base=(1LL*base*base)%mod;
        exponent>>=1;
    }
    return ans%mod;
}
int inv[10004];
int C(int n,int r){
    int res=1,cur=1;
    for(int i=n;i>r;i--){
        res=res*i%hell;
        res=res*inv[cur]%hell;
        cur++;
    }
    return res;
}
void solve(){
    int n,ans=0;
    cin>>n;
    if(n<5){
        cout<<0<<endl;
        return;
    }
    n-=5;
    rep(i,0,12){
        int r=n-i;
        if(r<0) break;
        if(r%2) continue;
        r/=2;
        ans=(ans+C(11,i)*C(15+r,r)%hell)%hell;
    }
    cout<<ans<<endl;
}

signed main(){
    rep(i,1,102) inv[i]=expo(i,hell-2,hell);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}