#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
long long int gcd1(long long int a, long long int b)
{
    long long int gcd,rem;
    while(1)
    {
        if(b%a==0)
        break;
        else
        {
            rem=b%a;
            b=a;
            a=rem;
            
        }
    }
    return a;
}
int main()
{
    long long int t,n,i,j,dif1=1,mul,gcd,res=0,mod=1000000007;
    cin>>t;
    while(t--)
    {
        res=0;
        dif1=1;
        cin>>n;
        res=((n+1)/2)*2;
        res%=mod;
        dif1=2;
        for(i=3;i<=41;i++)
        {
            
            gcd=gcd1(dif1,i);
            if(gcd==dif1||gcd==i)
            continue;
            mul=i/gcd;
            //cout<<gcd<<" "<<dif1<<" "<<i<<" "<<mul<<" "<<res<<endl;
            res=res+(n/dif1)*i;
            dif1*=mul;
            res=res-(n/dif1)*i;
            res=res%mod;
        }
        /*if(n==10000000000000000)
            cout<<366580019<<endl;
            else*/
        cout<<res<<endl;
    }
    return 0;
}