#include<stdio.h> int num(int x) { int a=0,b=0,m=x; while(m) { if(m&1) a++; else b++; m=m>>1; } if(a%2==0&&b%2!=0) return 1; else if (a%2!=0&&b%2==0) return 0; else if(a%2==0&&b%2==0) return 10; else return 100; } int main() { int n,x; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&x); printf("%d ",num(x)); } return 0; }