Task B-1.2. (20 points) Solve the inequality

$$
|||9-x|-x|+2 x| \leq 2009
$$
Solution. To solve this inequality, we need to solve the following two simpler inequalities:

$$
\begin{aligned}
& -2009 \leq|| 9-x|-x|+2 x \leq 2009, \quad \text { i.e. } \\
& -2009-2 x \leq|| 9-x|-x| \leq 2009-2 x
\end{aligned}
$$

We need to consider two cases:

$1^{\circ} \quad 9-x \leq 0 \quad$ i.e. $\quad x \geq 9$,

$2^{\circ} \quad 9-x>0 \quad$ i.e. $\quad x<9$.

$2^{\circ} a$

$$
\begin{aligned}
-2009-2 x & \leq 2 x-9 \leq 2009-2 x \\
-2000 & \leq 4 x \leq 2018 \\
-500 & \leq x \leq \frac{1009}{2}
\end{aligned}
$$

from which $x \in\left[\frac{9}{2}, 9\right)$.

$2^{\circ} b$

$$
-2009-2 x<9-2 x<2009-2 x \quad \text { i.e. } \quad-2018<2000
$$

Since this inequality is always satisfied, we get $x \in\left(-\infty, \frac{9}{2}\right)$.

The final solution is $x \in(-\infty, 1000]$.