#include #include #include #include #include #include using namespace std; #define ll long long ll memo[100000]={}; ll tetora(ll n){ if(n<4) return 0; else if(n==4) return 1; if(memo[n]) memo[n] = (tetora(n-1)+tetora(n-2)+tetora(n-3)+tetora(n-4))%17; return memo[n]; } int main(){ ll Q,num; cin >> Q; while(Q--){ cin >> num; cout << tetora(Q) << endl; } return 0; }