5. Around a round table stand $n$ empty glasses ( $n \geqslant 3$ ). Petya and Vasya take turns (starting with Petya) to pour kvass into them. Petya, on his turn, pours kvass into a chosen empty glass, which has both of its neighboring glasses either empty or full. Vasya, on his turn, pours kvass into a chosen empty glass, which has one neighboring glass empty and the other full. The player who cannot make a move loses. For which $n$ will Petya win regardless of Vasya's actions?
Answer: $n \neq 4$.

Solution. It is clear that $n=3$ works. The case $n=4$ does not work. Indeed, Vasya's first response move is to fill a glass next to the one Petya filled, after which Petya has no moves.

Let $n>4$. We will call a segment a block of several consecutive filled glasses, and a set of segments separated by one empty glass — a chain. Let's make two observations.

1) If before Vasya's move the filled glasses formed a chain, then after his move the chain will remain with the same number of segments.
2) If Petya fills a glass standing one away from the edge of a chain segment, then again a chain is formed, which has one more segment.

Petya's winning strategy is as follows. The first move he makes arbitrarily, obtaining a one-segment chain. If Vasya has no move, he loses. Otherwise, after Vasya's move, the chain is preserved according to 1). Then Petya fills a glass standing one away from the edge of the chain segment, if possible. Suppose that after $2k$ moves, it is no longer possible to act this way. Taking into account 2), this means that a chain has formed in which the gap between the extreme segments does not exceed two glasses. By this moment, there are $2k$ full glasses and no more than $k+1$ empty ones. Then $3k+1 \geqslant n>4$, from which $k \geqslant 2$. Inside the chain, there are $k-1 \geqslant 1$ empty glasses, and Petya can fill one of them with kvass. If the gap between the extreme segments of the chain contains only one glass, then Vasya has no move and he loses. If there are two such glasses, then Vasya can fill one of them with kvass, but the other will be surrounded by full glasses. Thus, Petya will have another move, while Vasya will have none.