Calculate the row index correctly for DNS.
Share the ROWS of A and the COLS of B, not the other way around.