Nim

JavaScript

Ending Condition:

The three piles are of sizes :

How many do you remove?