4B. Three weary travelers arrived at an inn and asked for food. The innkeeper had nothing else to offer them except baked potatoes. While the potatoes were baking, the travelers fell asleep. After some time, once the potatoes were ready, the first traveler woke up, took $\frac{1}{3}$ of the potatoes, and continued to sleep without waking the other travelers. Then the second traveler woke up, took $\frac{1}{3}$ of the remaining potatoes, and went back to sleep. Finally, the third traveler woke up and took $\frac{1}{3}$ of the remaining potatoes, and went back to sleep. The innkeeper had carefully observed all of this and when he counted the remaining potatoes, he saw that there were 8 left.

How many potatoes did the innkeeper bake?
Solution. First method. If we denote the number of apples that the angel baked by $x$, then after the first traveler's action, $x-\frac{1}{3} x$ apples remained. The second traveler took $\frac{1}{3}\left(x-\frac{1}{3} x\right)$ apples, after which $x-\frac{1}{3} x-\frac{1}{3}\left(x-\frac{1}{3} x\right)$ apples remained, from which the third traveler took $\frac{1}{3}\left(x-\frac{1}{3} x-\frac{1}{3}\left(x-\frac{1}{3} x\right)\right)$. Therefore, the angel counted

$$
x-\frac{1}{3} x-\frac{1}{3}\left(x-\frac{1}{3} x\right)-\frac{1}{3}\left(x-\frac{1}{3} x-\frac{1}{3}\left(x-\frac{1}{3} x\right)\right)
$$

apples. From the above, we obtain the equation

$$
x-\frac{1}{3} x-\frac{1}{3}\left(x-\frac{1}{3} x\right)-\frac{1}{3}\left(x-\frac{1}{3} x-\frac{1}{3}\left(x-\frac{1}{3} x\right)\right)=8
$$

whose solution is $x=27$, which is not difficult to obtain.

Thus, the angel baked 27 apples.

Second method. Clearly, the third traveler found 12 apples, since he took $\frac{1}{3}$ of them, and $\frac{2}{3}$ remained, i.e., 8. Similarly, we conclude that the second traveler found 18 apples, since he took $\frac{1}{3}$ of them, and $\frac{2}{3}$ remained, i.e., 12. The first traveler left 18 apples, which is $\frac{2}{3}$ of the apples he found. Therefore, he found 27 apples.

## Second Year