3B. We have a mixture $AB$ composed of substances $A$ and $B$ in a ratio of $2:3$, a mixture $BC$, composed of substances $B$ and $C$ in a ratio of $1:2$, and a mixture $CA$, composed in a ratio of $1:1$. How many grams of each mixture should be taken to obtain $24 \mathrm{~g}$ of a mixture in which the ratio of substances $A, B$, and $C$ is 1:1:1?
Solution. Let's take $x$ grams of the first mixture, $y$ grams of the second mixture, and $24-x-y$ grams of the third mixture. In the resulting mixture, there should be 8 grams of each of the substances. On the other hand, the resulting mixture contains $\frac{2}{5} x+\frac{1}{2}(24-x-y)$ grams of substance $A$ and $\frac{3}{5} x+\frac{1}{3} y$ grams of substance $B$. Solving the system of equations

$$
\left\{\begin{array}{l}
\frac{2}{5} x+\frac{1}{2}(24-x-y)=8 \\
\frac{3}{5} x+\frac{1}{3} y=8
\end{array}\right.
$$

we get $x=10, y=6$, and thus $z=8$.

Therefore, we need $10 \mathrm{~g}$ of the first, $6 \mathrm{~g}$ of the second, and $8 \mathrm{~g}$ of the third mixture.