for i in {0..49};do read j;k=0;y=1;for x in {0..7};do if [ ${j:$[7-$x]:1} = 1 ];then k=$[$k+$y];fi;y=$[2 * $y];done;for x in {0..22};do k=$[$k-$x];if [ 0 -eq $k ];then echo 1;break;elif [ $x -lt 0 ];then echo 0;fi;done;done