Crossword problem

I’m getting WA in 3rd test case . Please help me. Here is my code https://ide.codingblocks.com/s/303156