#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9 + 7;
ll after[100];
ll fp(ll x, ll y) {
	ll res = 1;
	while(y) {
		if(y & 1) res = res * x;
		y >>= 1;
		x = x * x;
	}
	return res;
}
int main() {
	int t;
	scanf("%d", &t);
	while(t--) {
		ll n; scanf("%lld", &n);
		ll ans = 0;
		for(ll i = 2; n; i++) {
			after[i] = i;
			for(ll j = 2; j < i; j++) {
				if(after[j] != 1 && after[i] % after[j] == 0) after[i] /= after[j];
			}
			ll cnt = (n / after[i]);
			ll else_cnt = n - cnt;
			ans += i * else_cnt;
			ans %= MOD;
			n -= else_cnt;
			// cout << " i = " << i << " new i = " << after[i] << " elsecnt = " << else_cnt << endl;
		}
		printf("%lld\n", ans);
	}
	return 0;
}