4. Pete and Vasya are playing such a game. Initially, there is one matchstick in each of 2022 boxes. In one move, you can transfer all the matchsticks from any non-empty box to any other non-empty box. They take turns, with Pete starting. The winner is the one who, after their move, has at least half of all the matchsticks in one box for the first time. Who will win with correct play? (I. Rubanov)
Answer: Vasya. Solution: Note that it does not matter whether matches are moved from box A to box B or from B to A: in both cases, one of the boxes becomes empty, and the other ends up with all the matches that were in both boxes. On his first move, Petya adds one match to one of the boxes. We will mark this box and consider that in the future, if this box is involved in the transfer, matches are added to it. Vasya, with his first move, also adds a match to the marked box. Further, Vasya plays as follows: if Petya, on his next move, adds a match to the marked box, Vasya also adds a match to it, and if Petya creates a box with two matches, Vasya transfers both these matches to the marked box. With such a strategy, after Vasya's $k$-th move, there will be $2 k+1$ matches in the marked box, and no more than one match in the others, and after Petya's $k$-th move, there will be $2 k$ or $2 k-1$ matches in the marked box, and no more than two matches in the others. Then, after Vasya's 505-th move, there will be 1011 matches in the marked box, and he will win, as before this, no box contained more than $2 \cdot 505=1010$ matches.