#include #include #include #include #include using namespace std; const int oo = 0x3f3f3f3f; const int maxn = 55555; int n ; char s1[1000], s2[1000]; bool ok(int x) { if(s1[x] == 'A' && s2[x] == 'U') return 1; if(s1[x] == 'T' && s2[x] == 'A') return 1; if(s1[x] == 'C' && s2[x] == 'G') return 1; if(s1[x] == 'G' && s2[x] == 'C') return 1; return 0 ; } int main() { int T ; scanf("%d",&T); while(T--) { scanf("%d",&n); if((3 * n) &1) cout << 1 << endl; else cout << 0 << endl; } return 0 ; }