#include int main() { int t; scanf("%d", &t); int n; int i, a[6] = { 1,3,4,5,7,8 }, f; for (; t > 0; t--) { scanf("%d", &n); f = 0; for (i = 0; i < 6; i++) if (n == a[i]) f++; if (f > 0) printf("1\n"); else printf("2\n"); } return 0; }