Given a MxN 0-1 matrix D, with the property that 1. both M and N are odd numbers 2. its row sums and column sums in the $\mathbb{Z}_2$ field are all equal to the same number (0 or 1). How do we find M binary numbers $r_i$ and N binary numbers $c_j$, such that $$ r_i + c_j = D_{ij} $$ is satisfied for as many cell $(i,j)$ as possible?