#include using namespace std; using lol=long long int; #define endl "\n" const lol mod1=1e9+7,mod2=998244353,mod3=100000000000000003,hashpr=31; const lol inf=9e18+8; const double eps=1e-12; const double PI=acos(-1.0); const int N=1e5+5; #include // Common file #include // Including tree_order_statistics_node_update using namespace __gnu_pbds; using ordered_set_type=lol; typedef tree,rb_tree_tag,tree_order_statistics_node_update> ordered_set; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); lol binexp(lol base,lol power){ if(power==0) return 1ll; lol res = binexp(base,power/2); res = (res*res)%mod2; if(power%2==1) res = (res*base)%mod2; return res; } const int mod = 1'000'000'007; struct Matrix{ using ll=long long int; vector> mat; Matrix(ll rows,ll cols){ mat.resize(rows,vector(cols,0)); } void Init(vector> values){ int rows = values.size(); int cols = values[0].size(); for(int i=0; i> M = { { 1,1,1,0,1,0,0,0,0,0,0,0,1}, // a[n-1] { 1,2,1,1,0,0,0,0,0,0,0,0,1}, // b[n-1] { 2,2,1,1,0,1,0,0,0,0,0,0,1}, // c[n-1] { 0,2,1,1,0,0,0,0,0,0,0,0,1}, // d[n-1] { 0,0,1,0,1,0,0,0,0,0,0,0,0}, // e[n-1] { 2,0,0,0,0,1,0,0,0,0,0,0,1}, // f[n-1] { 2,2,2,0,2,0,1,1,1,0,1,0,4}, // A[n-1] { 4,6,2,4,0,0,1,2,1,1,0,0,6}, // B[n-1] {12,8,2,6,0,5,2,2,1,1,0,1,8}, // C[n-1] { 0,4,2,2,0,0,0,2,1,1,0,0,4}, // D[n-1] { 0,0,4,0,4,0,0,0,1,0,1,0,0}, // E[n-1] {10,0,0,0,0,4,2,0,0,0,0,1,7}, // F[n-1] { 0,0,0,0,0,0,0,0,0,0,0,0,1}, // 1 // ans is sum over n of 2*A[n]+2*B[n]+C[n]+D[n]+E[n] }; void solve(){ lol n; Matrix res = Matrix(M.size(),M.size()); res.Init(M); cin>>n; res = res.geom(n); cout<<(2*res.mat[6][12]+2*res.mat[7][12]+res.mat[8][12]+res.mat[9][12]+res.mat[10][12])%mod<>_; while(_--) { solve(); } return 0; }