#include <bits/stdc++.h>
 
using namespace std;

const long long INFll = (long long) 1e18 + 10;
const int INFii = (int) 1e9 + 10;
typedef long long ll;
typedef int ii;
typedef double dbl;
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()

#define maxn 

vector<ll> p;
ll mod = (ll) 1e9 + 7;

void solve() {
    ll n;
    cin >> n;

    ll ans = 0;
    ll prod = 1;
    map<ll,ll> m;

    for(ll i = 1; i <= 50; i++) {
        ll prod1 = 1;
        ll prod2 = 1;

        for(auto x : m) {
            for(ii j = 0; j < x.sc; j++) {
                prod1*= x.fr;
            }
        }

        for(auto x : p) {
            ll c = 0;

            ll aux = i;
            while(aux%x == 0) {
                c++;
                aux/= x;
            }

            m[x] = max(m[x], c);
        }

        for(auto x : m) {
            for(ii j = 0; j < x.sc; j++) {
                prod2*= x.fr;
            }
        }

        if(prod1 > n) break;

        ans+= ((n/prod1 - n/prod2)%mod)*i;
        ans%= mod;
    }


    cout << ans << endl;



}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);

    //freopen("in.in", "r", stdin);
    //freopen(".out", "w", stdout);
    
    for(ll i = 2; i <= 100; i++) {
        bool ok = true;

        for(auto x : p) {
            if(i%x == 0) ok = false;
        }

        if(ok) p.pb(i);
    }

    ii tt = 1;
    cin >> tt;
    while(tt--) {
        solve();
    }
    
    return 0;

}
