#include #include using namespace std; int main() { int q; cin >> q; int n; vector tetoranatch; for(int i = 0; i < 4; i++) { tetoranatch.push_back(0); } tetoranatch.push_back(1); for(int i = 0; i < q; i++) { cin >> n; if(tetoranatch.size() - 1 < n) { while(tetoranatch.size() - 1 < n) { int tmp = 0; for(int j = 1; j <= 4; j++) { tmp += tetoranatch.at(tetoranatch.size() - j); } tetoranatch.push_back(tmp); } } cout << tetoranatch.at(n) % 17 << endl; } return 0; }