7. In a $4 \times 4$ grid of 16 small squares, fill in 2 $a$s and 2 $b$s, with at most one letter in each small square. If the same letter is neither in the same row nor in the same column, there are $\qquad$ ways to arrange them.
Solution: First, fill in the first $a$, there are 16 ways to fill it, then fill in the second $a$, there are 9 ways to arrange it,
considering the two $a$s are the same, there are $\frac{16 \times 9}{2}=72$ ways to arrange them,
now fill in the first $b$,
1) If the first $b$ is filled in such that the two $a$s are in the same row or column as the first $b$,
then the second $b$ has 9 ways to fill, at this point there are $\frac{9 \times 2}{2}=9$ ways to fill,
2) If the first $b$ is filled in such that only one $a$ is in the same row or column as the first $b$,
then the second $b$ has 8 ways to fill, at this point there are $\frac{8 \times 8}{2}=32$ ways to fill,
3) If the first $b$ is filled in such that the two $a$s are neither in the same row nor in the same column as the first $b$,
then the second $b$ has 7 ways to fill, at this point there are $\frac{7 \times 4}{2}=14$ ways to fill,
here there are 55 ways to fill,
according to the multiplication principle, there are $72 \times 55=3960$ ways to fill.