Task 1. A $3 \times 3$ square is filled with digits as shown in the figure on the left. It is allowed to move along the cells of this square, transitioning from one cell to an adjacent one (by side), but it is not allowed to visit any cell more than once.

| 1 | 8 | 4 |
| :--- | :--- | :--- |
| 6 | 3 | 9 |
| 5 | 7 | 2 |

![](https://cdn.mathpix.com/cropped/2024_05_06_13e5d2ec23c25d878726g-1.jpg?height=200&width=196&top_left_y=215&top_left_x=1125)
Petya walked as shown in the figure on the right and wrote down all the digits he encountered in order - resulting in the number 84937561. Draw another path so that the resulting number is larger (the larger, the better).
Answer. The largest number that can be obtained is -573618492 (see fig.).

Comments. 1. Let's explain how the problem could be solved (this was not required of the participants).

Notice that a number larger than the one given

| 1 | 8 | 4 |
| :---: | :---: | :---: |
| 6 | 3 | 9 |
| 5 | 7 | 2 |

in the problem can be obtained by starting the traversal from the number 9 (for example, it is not difficult to get the number 94836572). However, if all the cells of the board are traversed, a 9-digit number will result, which, of course, will be greater than any 8-digit number.

And a 9-digit number is also the larger the greater its first digit. One can notice that it is impossible to construct a 9-digit number starting with 9. In general, for none of the black cells (see fig. below) does there exist a path starting from it and passing through all the cells of the board (see the next comment).

Therefore, the largest number will be obtained by starting from the largest white cell, i.e., the digit 5. Next, one should move to its largest neighbor, the digit 7, then to its largest neighbor, the digit 3. But if one then goes to the largest neighbor of the digit 3, the digit 9, it will not be possible to traverse all the cells of the square. Similarly, it is not advisable to go to the digit 8. Therefore, from 3, one should move to 6. The path is then unique.