8. Colorful Ribbons (from 6th grade, 3 points). Vanya had five colorful ribbons of lengths 15, 20, 24, 26, and 30 cm in her jewelry box. Kolya cut off pieces from some (possibly all) of the ribbons. The average length of the ribbons decreased by 5 cm, while the median and range of the lengths remained unchanged. What are the new lengths of the ribbons now?
Solution. Let the shortest ribbon have a length of $x \, \text{cm}$ after Colin's action. Then the length of the longest ribbon is $x+15$ cm, since the range has not changed. Another ribbon has a length of 24 cm, as the median has remained the same, and the two unknown lengths are denoted as $y$ cm and $z$ cm, with $y \leq z$ for definiteness. This results in the chain of inequalities

$$
x \leq y \leq 24 \leq z \leq x+15
$$

From the inequality $24 \leq x+15$, it follows that $x \geq 9$, and therefore $y \geq 9$.

From the fact that the arithmetic mean has decreased by 5, we get the equation

$$
\frac{x+y+24+z+x+15}{5}+5=\frac{15+20+24+26+30}{5}
$$

from which $2x + y + z = 51$.

If $x = y = 9$, then $z = 51 - 2x - y = 24$. If at least one of the numbers $x$ or $y$ is greater than 9, then $z < 24$, which is impossible.

Therefore, $x = y = 9, z = 24$. Now the lengths of the ribbons are 9, 9, 24, 24, and 24 cm.

Answer: $9, 9, 24, 24$ and 24 cm.