Brute force solution for balls game.