s;;294 753 618 ;;$f=(OX)x9;{print$_,$u=chop$f;$n=<>-Q;s;$n;$u;e;$$u&1<<15-$n&&die$u.$/;$$u|=$$u[0]<<$n;$$u[0]|=1<<$n;redo}