Maximizing XOR problem