#include using namespace std; typedef pair pii; typedef long long int ll; int f(int n) { if (n <=3) return 0; else if (n == 4) return 1; else return (f(n-1)%17 + f(n-2)%17 + f(n-3)%17 + f(n-4)%17)%17; } int main() { cin.tie(0); ios::sync_with_stdio(false); int q; cin >> q; while (q--) { int t; cin >> t; cout << f(t) << endl; } return 0; }