#include <stdio.h> int main() { int a, b; int test(int x); scanf("%d",&a); int arr[1000]; int i,j; for(i=0;i<a;i++) { scanf("%d",&arr[i]); } for(i=0;i<a;i++) { test(arr[i]); } } int test(int x) { int g; int e; while(x>0) { if(x%2==0) { g++; } else { e++; } x=x/2; } if(g%2==0&&e%2!=0) { printf("0 "); } else if(g%2!=0&&e%2==0) { printf("1 "); } else if(g%2==0&&e%2==0) { printf("10 "); } else { printf("100 "); } return 0; }