There is a pile of 1000 matches. Two players each take turns and can take 1 to 5 matches. It is also allowed at most 10 times during the whole game to take 6 matches, for example 7 exceptional moves can be done by the first player and 3 moves by the second and then no more exceptional moves are allowed. Whoever takes the last match wins. Determine which player has a winning strategy.
The second player wins.

Let $r$ be the number of the remaining exceptional moves in the current position (at the beginning of the game $r=10$ and $r$ decreases during the game). The winning strategy of the
second player is the following. After his move the number of matches in the pile must have the form $6 n+r$, where $n>r$, or $7 n$, where $n \leq r$ (observe that $6 n+r=7 n$ for $n=r$ ).

At the beginning of the game the initial number of matches $1000=6 \cdot 165+10$ agrees with this strategy.

What happens during two consecutive moves?

Consider the case $n>r$ first. If the first player takes $k=1,2, \ldots 5$ matches (and hence $r$ is not changing during his move) then the second player takes $6-k$ matches. So players take 6 matches together and the pile contains now $6(n-1)+r$ matches.

If the first player takes 6 matches, then $r$ decreases by 1. The second player takes 1 match. After his turn the pile contains $6(n-1)+(r-1)$ matches as he wishes.

Now consider the case $n \leq r$. In this situation we have much enough exceptional moves, and we may assume that now each move the players can take up to 6 matches. Then if the first player takes $k$ matches, the second player takes $7-k$ matches.