#t541. 病毒
病毒
Recovering a Virus-Infected Document
Special for beginners, ^_^
Problem Description
One day little y suddenly found his computer infected by a virus! Fortunately, he found the virus is quite weak: it only replaces every letter in documents with some other letter, without changing the order, and without adding or deleting any letters.
Now how to recover the original document? Little y is clever: on another machine not infected by the virus, he generated a dictionary made of several words; the words in the dictionary are sorted in alphabetical order. He copied this file onto his own machine and deliberately let it get infected. He wants to use the original sortedness of this dictionary file to find the rule by which the virus replaces letters, and then use it to recover other documents.
Your task: given the virus-infected dictionary, recover a string of letters.
Input Format
The first line is an integer (): the number of words in the dictionary.
The next lines are the virus-infected dictionary, one word per line.
The last line is the string of letters you must recover.
All letters are lowercase.
Output Format
One line: the recovered string of letters. It may happen that the dictionary is incomplete, or even wrong; in that case output a 0.
Sample Input 1
6
cebdbac
cac
ecd
dca
aba
bac
cedab
Sample Output 1
abcde
Constraints
1s, 1024KiB for each test case.