4119: 键盘布局

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:6 通过:6

题目描述

Berland有两种流行的键盘布局,它们仅在字母位置上有所不同。所有其他键都相同。在伯兰,他们使用带有26个字母的字母表,这与英语字母表一致。

您将获得两个字符串,每个字符串由 26 个不同的字母组成:第一个和第二个布局的所有键按相同的顺序排列。

您还会收到一些由小写和大写英文字母和数字组成的文本。众所周知,它是在第一个布局中键入的,但编写者打算在第二个布局中键入它。如果在第二个布局中按下了相同的键,则打印文本。

由于除字母以外的所有键在两种布局中都相同,因此字母的大小写以及所有其他字符都应保持不变。

输入三个字符串,第一个字符串表示第一个键盘的布局,第二个字符串表示第二种键盘的布局,第三个字符串是 文本 。题目要求 按照第一种键盘输入文本,用第二种键盘输出文本(其中数字原样输出;如果源文本中为大写字母,则输出文本的也应该是大写字母;如果源文本中为小写字母,则输出文本也应该是小写字母)。

There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.

You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in the same order.
You are also given some text consisting of small and capital English letters and digits. It is known that it was typed in the first layout, but the writer intended to type it in the second layout. Print the text if the same keys were pressed in the second layout.
Since all keys but letters are the same in both layouts, the capitalization of the letters should remain the same, as well as all other characters.
Input
The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout.
The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout.
The third line contains a non-empty string s consisting of lowercase and uppercase English letters and digits. This is the text typed in the first layout. The length of s does not exceed 1000.
Output
Print the text if the same keys were pressed in the second layout.
Examples
Input
qwertyuiopasdfghjklzxcvbnm
veamhjsgqocnrbfxdtwkylupzi
TwccpQZAvb2017
Output
HelloVKCup2017
Input
mnbvcxzlkjhgfdsapoiuytrewq
asdfghjklqwertyuiopzxcvbnm
7abaCABAABAcaba7
Output
7uduGUDUUDUgudu7

输入格式

第一行包含一个长度为 26 的字符串,由不同的小写英文字母组成。这是第一个布局。

第二行包含一个长度为 26 的字符串,由不同的小写英文字母组成。这是第二种布局。

第三行包含一个非空字符串 s,由小写和大写英文字母和数字组成。这是在第一个布局中键入的文本。s 的长度不超过 1000。

输出格式

如果在第二个布局中按下了相同的键,则打印文本。

输入样例:

输入样例1:

qwertyuiopasdfghjklzxcvbnm

veamhjsgqocnrbfxdtwkylupzi

TwccpQZAvb2017

输出样例1:

HelloVKCup2017

输入样例2:

mnbvcxzlkjhgfdsapoiuytrewq

asdfghjklqwertyuiopzxcvbnm

输出样例2:

7uduGUDUUDUgudu7

输入样例 复制

qwertyuiopasdfghjklzxcvbnm

veamhjsgqocnrbfxdtwkylupzi

TwccpQZAvb2017

输出样例 复制

HelloVKCup2017