#include using namespace std; typedef long long ll; ll mod=17; vector> seki(vector> a,vector> b){ vector> ret; ll s=a.size(),t=b[0].size(); for(ll i=0;i c; for(ll j=0;j> kai(vector> a,ll n){ vector> ret=a; vector> now=a; for(ll i=0;i0){ if(n%2==1){ ret=seki(ret,now); } now=seki(now,now); n/=2; } return ret; } int main(){ ll q;cin>>q; vector> t={{1,1,1,1},{1,0,0,0},{0,1,0,0},{0,0,1,0}}; for(ll i=0;i>n; if(n<=3)cout<<0<> now=kai(t,n-4); cout<