8. (4 points) With the number written on the board, the following operation is allowed: erase two adjacent digits whose sum does not exceed 9, and write this sum in their place. Initially, a 300-digit number $12251225 \ldots 1225$ was written. The operation was performed on the number on the board until it was no longer possible. What is the largest number that could end up on the board as a result?

#
# Solution:

The sum of the digits of the original number $(1+2+2+5) \cdot 75=750$. The sum of the digits of the final number is the same.

Let's break down the digits of the final number into pairs: the first with the second, the third with the fourth, and so on. The last digit may remain unpaired. In each pair, the sum of the digits is at least ten, which means the number cannot have more than 150 digits. Since 150-digit numbers exceed all numbers with fewer digits, we should primarily look for the answer among them.

If the number has exactly 150 digits, and the sum of the digits in any pair is greater than 10, then the total sum of the digits is greater than 750. Therefore, in any 150-digit number that we can obtain, the sum of the digits in each pair must be exactly 10.

Note: The statement that in each such number the sum of adjacent digits is 10 is generally incorrect: for example, the number $375555 \ldots 55$ can be obtained, in which this condition is violated.

In each pair, we need to maximize the first digit and minimize the second. Since each pair of digits is obtained by the operations specified in the condition from 1225, the second digit is not less than 5, and the largest variant for each pair is 55, from which we get the answer.

## 11th grade

## 3rd variant