                                                     /*CP is fun!*/
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define int long long
using namespace std;
const int MAXN=2e5+5;
const int MOD=1e9+7;
const int MAX=1e3;

ll powerm(ll a,ll b,ll m) { //m-> mod
    if(b==0) {
        return 1;
    }
    ll res=powerm(a,b/2,m);
    if(b%2) {
        return ((res*res)%m*(a%m))%m;
    }
    return (res*res)%m;
}

//INVERSE -> a^(m-2) ...m -> prime

int power(ll a,ll b) {
    if(b==0) {
        return 1;
    }
    ll res=power(a,b/2);
    if(b%2==0) {
        return res*res;
    }
    return res*res*a;
}

/*vector<int>fac(1e5);

void facm(ll m) { //factorial mod precompute
    fac[0]=1;
    for(int i=1;i<fac.size();i++) { //name an array fac
        fac[i]=((i)%m*fac[i-1])%m;
    }
    return;
}

ll choose(ll a,ll b,ll m) { //a choose b mod m
    if(a<b) {
        return 1;
    }
    ll ans=((fac[a]*(powerm(fac[a-b],m-2,m)))%m*powerm(fac[b],m-2,m))%m;
    return ans;
}*/

int gcd(int a,int b) {
    if(a==0) {
        return b;
    }
    if(b==0) {
        return a;
    }
    return gcd(b%a,a);
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //cout<<setprecision(9)<<fixed;
    //freopen("diamond.in","r",stdin);
    //freopen("diamond.out","w",stdout);
    int t;
    cin>>t;
    while(t--) {
        int n,l=1,ans=0;
        cin>>n;
        for(int x=2;x<=42;x++) {
            for(int j=1;j<x;j++) { //remainder by x
                if((j*(l%x))%x!=0 && j*l<=n) {
                    ans=(ans+((n/l-j)/x + 1)*x)%MOD;
                }
            }
            l=l*(x/gcd(l,x));
        }
        cout<<ans<<"\n";
    }
    return 0;
}




