#include using namespace std; int main() { int dp[9] = {0, 1, 2, 1, 1, 1, 2, 1, 1}; int t; cin >> t; while (t--) { int n; cin >> n; if (n >= 9) { cout << 2 << endl; } else { cout << dp[n] << endl; } } return 0; }