#include using namespace std; int t, n; set s = { 1, 3, 4, 5, 7, 8 }; int main() { cin >> t; for (int i = 0; i < t; i++) { cin >> n; if (s.find(n) != s.end()) cout << 1 << endl; else cout << 2 << endl; } }