Input consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. Each dictionary entry is a line containing an English word, followed by a space and a foreign language word. No foreign word appears more than once in the dictionary. The message is a sequence of words in the foreign language, one word on each line. Each word in the input is a sequence of at most 10 lowercase letters.
题目修改如下:
先输入一个n(1 ≤ n ≤ 100000),表示字典中单词对的数量。单词对由“英文单词 - 外语单词”组成。
接下来n行,每行一个单词对,每个单词长度不超过10,且只包含小写字母。
然后输入一个m(1 ≤ m ≤ 100000),表示询问的次数。
每次询问输入一串外语单词,如果能在字典中找到对应的单词对,则输出对应的英文单词,否则,输出“eh”。
注:字典中的外语单词不会重复
5 dog ogday cat atcay pig igpay froot ootfray loops oopslay 3 atcay ittenkay oopslay
cat eh loops