#include using namespace std; int main() { int t; cin >> t; while (t--) { long long x; cin >> x; if (x == 1 || x == 3 || x == 5 || x == 7 || x == 4 || x == 8) { cout << 1 << endl; } else { cout << 2 << endl; } } return 0; }