Programming Contest
Problem E     Crossword Jumble

Alice has found a new way to secretly communicate with Bob.  The method uses a crossword-puzzle-like arangement on a 12 by 12 grid.  The rows and columns of the grid are numbered 1 through 12.  Alice sends Bob a file with a list of words and specifications as to where to place them on the grid.  Specification for one word  might look like this

1 3 d ingrown

This indicates that the word "ingrown" is to be placed on the grid starting at row 1, column 3 and going down ('d' for down, 'a' is for across).  The file starts with the number of words to put on the grid, then each word's specification is given on a separate line.

The secret message is extracted by examining the grid and looking at only those letters that are used in positions both horizontally and vertically.  The doubly-used letters are read left to right, top to bottom to get the message.  The file cross1.txt has the contents shown on the left and should be put on the grid as shown at the right.

                                        123456789012

10                                  1     i stopped
1 3 d ingrown                       2     n
5 7 d smooth                        3   egghead
4 7 a heart                         4     r   heart
3 1 a egghead                       5   o opposite
10 2 a two                          6   t w   m
5 1 d other                         7   h n   o
8 3 a lookout                       8   e lookout
5 3 a opposite                      9   r a   t
8 3 d laws                          0    two  h
1 5 a stopped                       1     s
                                    2

The doubly-used letters are shown in bold in the grid above.  When read properly, these letters form the message: goslow

Your program must prompt for the name of the file containing words, read in the word specifications and then display on the screen the secret message.