Gimme The MoneyDiscrete Mathematics Level 2
They place three heaps of coins on a table. The first heap has \(10\) coins, the second heap has \(7\) coins, and the third heap has \(9\) coins.
The second player adds another pile of coins on the table, having at most \(10\) coins.
The players take turns alternately, starting with the first player. At each move, the player has to remove a positive number of coins from one heap. The player who removes the last coin wins.
It turns out that regardless of the strategy of the first player, the second player always wins with optimal play. How many coins should the second player add in the fourth pile?