Program to find out a word from a grid of characters