#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a r(2e5+1); r[1]=1; r[2]=1; for(ll i=3;i<=2e5;i++) r[i]=(r[i-1]+r[i-2])%mod; vector e(2e5+1); e[1]=1; e[2]=3; for(ll i=3;i<=2e5;i++) e[i]=(e[i-1]+e[i-2])%mod; ll q; cin >> q; while(q--){ ll n; cin >> n; cout << (5*r[n]%mod*r[n]%mod-(e[n]*e[n]%mod)+mod)%mod << '\n'; } }