Task 1 - 340721 Grandfather had brought his three grandchildren a basket of nuts that they were supposed to share fairly. Lars, who was alone in the house, took his share first: He took one-third of the nuts from the basket.

Katja, upon coming home, not knowing that Lars had already helped himself, took one-third of the remaining nuts in the basket.

Finally, Markus also took one-third of the remaining nuts in the basket. There were still 16 nuts left in the basket.

How many nuts did each of the three children take?
If there were $n$ nuts in the basket at the beginning, then:

Lars took $\frac{n}{3}$ nuts, after which $\frac{2 n}{3}$ nuts remained in the basket.

Of these, Katja took $\frac{1}{3} \frac{2 n}{3}=\frac{2 n}{9}$ nuts, after which $\frac{2 n}{3}-\frac{2 n}{9}=\frac{4 n}{9}$ nuts remained in the basket.

Of these, Markus took $\frac{1}{3} \frac{4 n}{9}=\frac{4 n}{27}$ nuts, after which $\frac{4 n}{9}-\frac{4 n}{27}=\frac{8 n}{27}$ nuts remained in the basket. Since this was 16 nuts, it follows that $\frac{8 n}{27}=16$ and from this $n=54$.

Thus, there were 54 nuts in the basket at the beginning.

Of these, Lars took 18 nuts, of the remaining 36 nuts, Katja took 12 nuts, of the remaining 24 nuts, Markus took 8 nuts.