#include #include using namespace std; #define maxn 100001 #define LL long long const LL mod=1000000007; LL x[maxn],y[maxn],z[maxn],phi[maxn],n; void init() { LL i,j,k; for(i=2;i>T; while(T--) { LL k,t,ans,m; cin>>n; n++; t=(n*n)%mod; LL md=mod*6; ans=t*(t-1)%md*(t-2)%md/6; ans-=t*(n-1)%md*(n-2)*2%md/6; t=0; for(k=2;k