i;b;s,t;main(x){for(;t=s,~scanf("%d",&s);i++>8?b=i=!printf("%d\n",!b):0)b|=i&&(x=s^t)&x-1|!x;}