Xor profit problem