This is the misère version of Nim; it is **very** well studied, and the winning strategies for both the regular and the misère versions are described (and their correctness proved) in the linked article.
This is the misère version of Nim; it is **very** well studied, and the winning strategies for both the regular and the misère versions are described (and their correctness proved) in the linked article.