Script to solve the marbles game.