7. (4 points) With the number written on the board, one of the following operations is allowed:
1) If there is a digit in the original number that is not equal to 9 and has two neighboring digits greater than 0, you can increase this digit by 1, and decrease the neighboring digits by 1.
2) Subtract 1 from any non-zero digit except the last one, and add 3 to the next digit.
3) Decrease any sufficiently large digit by 7.

If, as a result of any of these operations, there are zeros in the number on one or more of the leading positions, they are automatically discarded.

Initially, the number consisting of one hundred nines was written on the board. In the end, a single-digit number remained. Which one exactly?
# Answer: 3

Solution:

The first operation corresponds to subtracting a number of the form $910 \cdot 0$, the second and third - subtracting $70 \cdot 0$. Both these operations do not change the remainder of the original number when divided by 7, since 91 is divisible by 7.

$1001 = 91 \cdot 11$, and $999999 = 999 \cdot 1001$. Therefore, to find the remainder of the original number when divided by 7, the number of nines that are multiples of 6 can be discarded. The remaining number is $9999 = 9009 + 987 + 3 = 9 \cdot 1001 + 7 \cdot 141 + 3$, which gives a remainder of 3.