ZOJ Problem Set - 1546
Alex likes solving fillwords. Fillword is a word game with very simple rules.
The author of the fillword takes rectangular grid (M cells width, N cells height)
and P words. Then he writes letters in the cells of the grid (one letter in
one cell) so that each word can be found on the grid and the following conditions
Your task is to help Alex to solve fillwords. You should find out which letters will be left after he finds all the words on the grid. The most difficult task - to make up a secret word out of them - we still reserve to Alex.
The first line of the input file contains three integer numbers - N, M (2 <=
M, N <= 10) and P (P <= 100). Next N lines contain M characters each,
and represent the grid. The following P lines contain words that are to be found
on the fillword grid.
Process to the end of file.
Output letters from, which a secret word should be made up. Letters should be output in lexicographical order.
3 3 2
Source: Northeastern Europe 2001, Northern Subregion