10. Find the maximum of the expression
$$
|| \ldots|| x_{1}-x_{2}\left|-x_{3}\right|-\ldots\left|-x_{2023}\right|,
$$
where $x_{1}, x_{2}, \ldots, x_{2023}$ are distinct natural numbers between 1 and 2023 .
Solution. Answer: 2022.
Since for $x \geq 0, y \geq 0$ the inequality $|x-y| \leq \max \{x, y\}$ holds, then by induction
$$
|| \ldots|| x_{1}-x_{2}\left|-x_{3}\right|-\ldots\left|-x_{n}\right| \leq \max \left\{x_{1}, x_{2}, \ldots, x_{n}\right\}
$$
and hence the maximum of the expression in question is not greater than 2023. This value 2023 can not however be achieved since
$$
|| \ldots|| x_{1}-x_{2}\left|-x_{3}\right|-\ldots\left|-x_{2023}\right| \equiv x_{1}+x_{2}+\ldots+x_{2023}=1012 \cdot 2023(\bmod 2) \text {, }
$$
and, in particularly, even.
2022, however, can be achieved as the following example shows.
$$
\begin{array}{l}
|||||\ldots||||\ldots \ldots||||| 1-2 \mid \\
\quad-3|-5|-6|-4|-\ldots \\
\cdots-(4 k-1)|-(4 k+1)|-(4 k+2)|-4 k|-\ldots \\
\cdots-2020|-2021|-2022|-2020|-2023 \mid \\
\quad=|1-2023|=2022 .
\end{array}
$$

It is easy to understand it if to have in mind that $|1-2|=1$ and $|1-(4 k-1)|-$ $(4 k+1)|-(4 k+2)|-4 k \mid=1$ for any $k \geq 1$.