Logo
(追記) (追記ここまで)

18679번 - Banana 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB51139034278.082%

문제

After NASA discovered water on Mars, they decided to expand their exploration hoping to find some alien intelligence on the planet. After months of exploration, they were actually surprised to find out that the planet has been inhabited by minions.

NASA started communications with the minions and the first message they received was Mo amo Banana. At first, it was really hard to decipher the message but after sometime they managed to workout a dictionary that maps English words to Minionese words. You are going to help NASA build the translator to ease their communication with Minions for the good and prosperity of mankind and minionkind.

입력

The first line of input will contain a single integer N, the number of words in the dictionary (1 ≤ N ≤ 100). The following N lines will each contain a sentence of the format x = y where x is an English word and y is a Minionese word. The next line will contain an integer T, the number of test cases (1 ≤ T ≤ 100). Each test case will start with a line containing an integer K, the number of words in the sentence (1 ≤ K ≤ 100) and the next line will contain K space separated English words. All the English words in the test cases exist in the defined dictionary. Also, all the words consist only of English alphabet, and will be at most 20 characters long.

출력

For each test case, print a single line containing the space separated Minionese words after translation.

제한

예제 입력 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

힌트

출처

ICPC > Regionals > Africa and Arab > Arab Collegiate Programming Contest > 2015 Arab Collegiate Programming Contest J번

  • 데이터를 추가한 사람: xb205
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /