Given a 29-digit number $X=\overline{a_{1}} \overline{-} \overline{-} \overline{29}\left(0 \leq a_{k} \leq 9, a_{1} \neq 0\right)$. It is known that for every $k$ the digit $a_{k}$ appears $a_{30-k}$ times in the number (for example, if $a_{10}=7$, then the digit $a_{20}$ appears seven times). Find the sum of the digits of the number $X$.
Let's divide all numbers into pairs $\left(a_{k}, a_{30-k}\right)$. Notice that if among these pairs there is a pair $(a, b)$, then pairs $(a, c)$ and $(c, a)$, where $c \neq b$, cannot occur, otherwise the digit $a$ would have to appear in the number $X$ $b$ times on one side and $c$ times on the other. Therefore, if the pair $(a, b)$ occurs, then $b$ must always be paired with $a$, and $a$ with $b$. This means that the pairs $(a, b)$ and $(b, a)$ together occur $a$ times on one side, since the digit $b$ appears $a$ times, and $b$ times on the other side, since the digit $a$ appears $b$ times. Therefore, $a=b$. Thus, the digit $a$ appears $a$ times, and $a_{k}=a_{30-k}$. Also notice that only the digit in the middle can appear an odd number of times, while all others must appear an even number of times. Since the digit $a$ appears $a$ times and

$0 \leq a \leq 9$, we get that the maximum number of digits in such a number is $9+8+6+4+2=29$ and is achieved only when there are 9 nines, 8 eights, 6 sixes, 4 fours, and 2 twos. Therefore, the sum of the digits of the number $X$ is $2 \cdot 2+4 \cdot 4+6 \cdot 6+8 \cdot 8+9 \cdot 9=201$.

## Answer

201.