Oleksii placed positive integers in the cells of the chessboard of size . For each pair of adjacent cells, Fedir wrote down the product of the numbers in them and added all the obtained numbers. Oleksii wrote down the sum of the numbers in each pair of adjacent cells and multiplied all the obtained numbers. It turned out that both numbers have the same last digit, . Prove that at least one of the boys made a mistake in the calculation. For example, for the square and the given arrangement of numbers (fig. 11), Fedir would write the following numbers: , , , , , , , , , , , and their sum ends with digit , and Oleksii would write the following numbers: , , , , , , , , , , , and their product ends with digit .
(Oleksii Masalitin, Fedir Yudin)
| 1 | 2 | 3 |
|---|---|---|
| 2 | 4 | 6 |
| 3 | 5 | 7 |
Fig. 11