#include <iostream>
using namespace std;
int t, n;
int main() {
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
printf("%d\n", n == 3 ? 3 : 2);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCB0LCBuOwoKaW50IG1haW4oKSB7CiAgICBzY2FuZigiJWQiLCAmdCk7CiAgICAKICAgIHdoaWxlICh0LS0pIHsKICAgICAgICBzY2FuZigiJWQiLCAmbik7CiAgICAgICAgcHJpbnRmKCIlZFxuIiwgbiA9PSAzID8gMyA6IDIpOwogICAgfQogICAgcmV0dXJuIDA7Cn0=