The “square game” is one of many games that two players can play with a pile of pebbles. The players alternate, each taking a number of pebbles that must be a perfect square (1, 4, 9, 16, 25, 36, ...). Whoever takes the last pebbles wins the game.

For example, if the pile starts out with 20 piles and player A takes 16 pebbles, then player B can take 4 pebbles to win.

Implement a class that tracks the game progress.