Solves medium puzzles