Build data structure with all possibilities for every m1 position. Every string is m1 XOR mi XOR spaces.