Problem 5.1. Denis placed the numbers from 1 to 9 in the cells of a $3 \times 3$ square such that the sum of the numbers in all rows and all columns is 15. And then Lesha erased the numbers from 1 to 5 and wrote the letters $A, B, C, D$, and $E$ instead. The resulting square is shown in the figure.

| $\mathbf{9}$ | $A$ | $B$ |
| :---: | :---: | :---: |
| $C$ | $\mathbf{6}$ | $\mathbf{7}$ |
| $D$ | $\mathbf{8}$ | $E$ |

What numbers were originally in the cells?
(a) Instead of the letter $A$
(1) the number 1 stood.
(b) Instead of the letter $B$
(2) the number 2 stood.
(c) Instead of the letter $C$
(3) the number 3 stood.
(d) Instead of the letter $D$
(4) the number 4 stood.
(e) Instead of the letter $E$
(5) the number 5 stood.
Answer: a1 b5 c2 d4 e3.

Solution. Let's look at the second row. The sum of the numbers in it is $C+6+7=15$, from which $C=2$. Similarly, in the second column, we have the sum of the numbers $A+6+8=15$, from which $A=1$.

Now we can write down the sums of the numbers in the first row and in the first column - these are $9+1+B=15$ and $9+2+D=15$. From them, we get that $D=4$ and $B=5$. It only remains to find $E$ from the sum of the numbers in the last column $5+7+E=15$, which gives $E=3$.