3B. Solve the system of equations

$$
\left\{\begin{array}{l}
x+y=z \\
x^{2}+y^{2}=z \\
x^{3}+y^{3}=z
\end{array}\right.
$$
Solution. The third equation of the system will be transformed into the form $x^{3}+y^{3}=(x+y)^{3}-3 x y(x+y)$, that is, $z=z^{3}-3 x y z$. Meanwhile, from the formula for the square of a binomial, we have $x y=\frac{1}{2}\left((x+y)^{2}-\left(x^{2}+y^{2}\right)\right)$, and finally the third equation of the system takes the form

$$
z=z^{3}-\frac{3}{2} z\left(z^{2}-z\right)
$$

After rearranging, it becomes

$$
z^{3}-3 z^{2}+2 z=0 \Leftrightarrow z(z-1)(z-2)=0
$$

from which the solutions for the variable $z$ are $z \in\{0,1,2\}$. For each of the individual values of $z$, we solve systems of two equations with two unknowns

$$
\left\{\begin{array}{l}
x+y=z \\
x^{2}+y^{2}=z
\end{array}\right.
$$

Thus, for the first system, for $z=0$, we have:

$$
\left\{\begin{array}{l}
x+y=0 \\
x^{2}+y^{2}=0
\end{array}\right.
$$

with the solution $x=y=0$.

For $z=1$, the system takes the form

$$
\left\{\begin{array}{l}
x+y=1 \\
x^{2}+y^{2}=1
\end{array}\right.
$$

which, by substitution from the first into the second equation and solving a quadratic equation, gives the solutions $x=0, y=1$ and $x=1, y=0$.

For $z=2$, the system takes the form

$$
\left\{\begin{array}{l}
x+y=2 \\
x^{2}+y^{2}=2
\end{array}\right.
$$

which, similarly to the previous case, solving a quadratic equation gives the solutions $x=y=1$.

Finally, the solutions to the original system are the ordered triples

$$
(x, y, z) \in\{(0,0,0),(0,1,1),(1,0,1),(1,1,2)\}
$$