from tourist_translations.translator import Translator

def main(args = None):
    try:
        number_of_translations, alphabet = input().split()
        translator = Translator(alphabet)
        for _ in range(int(number_of_translations)):
            phrase = input()
            translated_phrase = translator.translate(phrase)    
            print(translated_phrase)
    except EOFError:
        pass

if __name__ == "__main__":
    main()
af1d8e633b0c158626ed9138e821a8dfe6d96765
<mask token>

<mask token>


def main(args=None):
    try:
        number_of_translations, alphabet = input().split()
        translator = Translator(alphabet)
        for _ in range(int(number_of_translations)):
            phrase = input()
            translated_phrase = translator.translate(phrase)
            print(translated_phrase)
    except EOFError:
        pass


<mask token>

<mask token>


def main(args=None):
    try:
        number_of_translations, alphabet = input().split()
        translator = Translator(alphabet)
        for _ in range(int(number_of_translations)):
            phrase = input()
            translated_phrase = translator.translate(phrase)
            print(translated_phrase)
    except EOFError:
        pass


if __name__ == '__main__':
    main()

from tourist_translations.translator import Translator


def main(args=None):
    try:
        number_of_translations, alphabet = input().split()
        translator = Translator(alphabet)
        for _ in range(int(number_of_translations)):
            phrase = input()
            translated_phrase = translator.translate(phrase)
            print(translated_phrase)
    except EOFError:
        pass


if __name__ == '__main__':
    main()

from tourist_translations.translator import Translator

def main(args = None):
    try:
        number_of_translations, alphabet = input().split()
        translator = Translator(alphabet)
        for _ in range(int(number_of_translations)):
            phrase = input()
            translated_phrase = translator.translate(phrase)    
            print(translated_phrase)
    except EOFError:
        pass

if __name__ == "__main__":
    main()