5. Let $a$ be a natural number with 2019 digits and divisible by 9. Let $b$ be the sum of the digits of $a$, let $c$ be the sum of the digits of $b$, and let $d$ be the sum of the digits of $c$. Determine the number $d$.

## Third grade - B category
5. Since the number a is divisible by 9, the sum of its digits must be divisible by 9, i.e., the number $b$ is divisible by 9. From there, for the same reason, the number c is also divisible by 9, and then we conclude that the number $d$ is divisible by 9. Further, since the number a has 2019 digits, and each of its digits can be at most 9, it follows that the number $b$ is at most $2019 \cdot 9=18171$. The number $c$, therefore, is at most $1+8+9+9+9=36$ (since the digits in the number $b$ at the fourth and fifth positions from the right, if they exist at all, are at most 8 and 1, respectively, while the other digits are at most 9), and then the number $d$ can be at most $2+9$, i.e., at most 11. Thus, combining the obtained conclusions, we conclude that $d$ is a number that is not greater than 11 and is divisible by 9; therefore, the only possibility is $d=9$.

## Third Grade - B Category