Improved program. Bruteforce can now solve harder puzzles.