#include #include using namespace std; using ll = long long; int main(){ vector t(1000000); t[0] = 0; t[1] = 0; t[2] = 0; t[3] = 1; for(int i=4; i<1000000; i++) t[i] = (t[i-1] + t[i-2] + t[i-3] + t[i-4]) % 17; int q; cin >> q; int n; while(q--){ cin >> n; cout << t[n-1] << endl; } }