4. On the table, there are three piles of candies, the first has 10 pieces, the second has 20 pieces, and the third has 30 pieces. Masha and Rita are playing a game - they take turns dividing any pile of candies on the table into two parts. The game ends when one of the girls cannot make a move and thus loses. Masha goes first. Who will win this game?
Solution. Any pile can be divided, including one consisting of two candies. Therefore, the game will end when all candies are divided into piles of one candy each. Previous moves do not affect the next move - as long as there are piles left, one candy can be separated from the others. To divide 60 candies, initially in one large pile, into 60 piles, 59 moves are needed. According to the problem, two moves have already been made, resulting in three piles. There are 57 moves left. Since the last, odd-numbered, move will be made by Masha.

Answer. Masha will win.