Problem

Source: Kyiv City MO 2022 Round 2, Problem 7.4

Tags: combinatorics, game, GCD



Fedir and Mykhailo have three piles of stones: the first contains $100$ stones, the second $101$, the third $102$. They are playing a game, going in turns, Fedir makes the first move. In one move player can select any two piles of stones, let's say they have $a$ and $b$ stones left correspondently, and remove $gcd(a, b)$ stones from each of them. The player after whose move some pile becomes empty for the first time wins. Who has a winning strategy? As a reminder, $gcd(a, b)$ denotes the greatest common divisor of $a, b$. (Proposed by Oleksii Masalitin)