Problem F: 全量替换

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:23 Solved:10

Description

又到情报暗语全线更新的时间点: 这次总部要求将 news中所有指定的 n个单词 s 更改为新的单词 t。

注意: 这次不能只改一处,而是要全量替换。

例如:news="The Boss can't find the tie I gave Boss."

          更改2处。将 "Boss" 更改为 "Director". 将"tie" 更改为 "cap"。

         全量替换后 news="The Director can't find the cap I gave Director." 

Input

输入第一行为 字符串 news 。

输入第二行为 n个指定的更改单词。

输入第三行为 n个原单词 s ,单词间空格分隔。

输入第四行为 对应替换原单词的 n个新单词 t ,单词间空格分隔。

Output

输出一个全量替换后的字符串 news 。

Sample Input Copy

The Boss can't find the tie I gave Boss.
2
Boss tie 
Director cap

Sample Output Copy

The Director can't find the cap I gave Director.

HINT

n<10。1=<news文本的单词数<=1000。