Automatic translation

Given n words in one language X, and a text with m words written in
another language Y, print all the possible translations of the text to
X, assuming that there is a bijection between the words of X and Y.

Input

Input consists of several cases. Every case begins with n, followed by
the n words of the language X, in increasing order, each one made up of
between one and six lowercase letters. Follow m, followed by the m words
of the text written in Y, each one made up of between one and six
uppercase letters. This text contains exactly n different words. Assume
1 ≤ n ≤ 6 and n ≤ m ≤ 1000.

Output

For every case, print in alphabetical order all the possible
translations of the text in Y to X. Print a line with 10 dashes at the
end of each case.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:12:25.406Z

© Jutge.org, 2006–2026.
https://jutge.org
