What Are You Talking About
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/204800 K (Java/Others)
Total Submission(s): 21684 Accepted Submission(s): 7241
Problem Description
Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want to translate the history book into English. Can you help him?
Input
The problem has only one test case, the test case consists of two parts, the dictionary part andthe book part. The dictionary part starts with a single line contains a string"START", this string should be ignored, thensome lines follow, each line contains two strings, thefirst one is a wordin English, thesecond one isthe corresponding wordin Martian's language. A line with a single string"END" indicates theendofthe directory part, and this string should be ignored. The book part starts with a single line contains a string"START", this string should be ignored, then an article written in Martian's language. You should translate the article into English withthe dictionary. If you find thewordinthe dictionary you should translate itandwritethe new wordinto your translation, if you can't find thewordinthe dictionary you do not have to translate it, and just copythe old wordto your translation. Space(' '), tab('\t'), enter('\n') and all the punctuation should not be translated. A line with a single string"END" indicates theendofthe book part, andthat's also theendofthe input. All thewords are inthe lowercase, and each word will containat most 10characters, and each line will containat most 3000characters.
Output
In this problem, you have to output the translation ofthe history book.
Sample Input
START
from fiwo
hello difh
mars riwosf
earth fnnvk
like fiiwj
END
START
difh, i'm fiwo riwosf.
i fiiwj fnnvk!
END
Sample Output
hello, i'm from mars.
i like earth!
What Are You Talking AboutTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 21684 Accepted Submission(s): 7241Problem DescriptionIgnatius