The magician Magimático calls three people from the audience: Ana, Beto, and Caio, to help with his mathemagic. He tells each of them to think of a number between 1 and 50, without revealing it to the magician, and to tell it to the other two participants. Then, each of them must simultaneously replace their number with the sum of the numbers of the other two. For example, Ana will have the sum of Beto's and Caio's numbers. Magimático then asks them to repeat this process one more time. After completing the second exchange, he asks them to say their numbers. Ana answers 104, Beto 123, and Caio 137. To everyone's surprise, Magimático correctly guesses the initial numbers chosen by the three. What were the initial numbers chosen?

#
Solution

Let's call Ana's number $A$, Beto's number $B$, and Caio's number $C$. In the first exchange, Ana ended up with $B+C$, Beto with $A+C$, and Caio with $A+B$. After the second exchange, Ana ended up with $A+C+A+B=2 A+B+C$, Beto with $A+2 B+C$, and Caio with $A+B+2 C$. From the final answers they gave, we know that:

$$
\begin{aligned}
2 A+B+C & =104 \\
A+2 B+C & =123 \\
A+B+2 C & =137
\end{aligned}
$$

Adding the three equations, we get $4 A+4 B+4 C=104+123+137=364$, that is, $A+B+C=$ 91. Subtracting this value from each of the three equations, we obtain $A=13, B=32$ and $C=46$.