Solution to the word search problem.