Bit manipulation puzzle