QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100

#12886. 香蕉

الإحصائيات

在 NASA 发现火星上有水之后,他们决定扩大探索范围,希望能找到火星上的外星智慧生命。经过数月的探索,他们惊讶地发现这颗行星竟然居住着小黄人(minions)。

NASA 开始与小黄人进行交流,收到的第一条信息是 Mo amo Banana。起初,破译这条信息非常困难,但经过一段时间后,他们成功整理出了一本将英语单词映射为小黄人语单词的字典。你需要帮助 NASA 构建一个翻译器,以促进他们与小黄人之间的交流,造福人类和小黄人。

输入格式

输入的第一行包含一个整数 $N$,表示字典中的单词数量 ($1 \le N \le 100$)。接下来的 $N$ 行,每行包含一个格式为 $x = y$ 的句子,其中 $x$ 是一个英语单词,$y$ 是对应的小黄人语单词。下一行包含一个整数 $T$,表示测试用例的数量 ($1 \le T \le 100$)。每个测试用例以一行包含一个整数 $K$ 开始,表示句子中的单词数量 ($1 \le K \le 100$),接下来的下一行包含 $K$ 个以空格分隔的英语单词。所有测试用例中的单词均仅由英文字母组成,且长度不超过 20 个字符。

输出格式

对于每个测试用例,打印一行包含翻译后以空格分隔的小黄人语单词。

样例

输入格式 1

4
I = mo
love = amo
icecream = gelatooo
banana = banana
2
3
I love banana
3
I love icecream

输出格式 1

mo amo banana
mo amo gelatooo

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.