Attack of the CipherTexts

No attempts yetTime limit1sMemory limit128 MB

Problem

Ruby is a code-breaker. She knows that two dangerous people, Mr. X and Mr. Z, are sending secret messages to each other about very bad things.

Ruby has intercepted one plaintext message together with its corresponding ciphertext. The plaintext is the original, readable message; the ciphertext is the encrypted, scrambled version. To encrypt a message, every letter is replaced by another letter so that the ciphertext does not reveal the plaintext.

Ruby knows the algorithm Mr. X and Mr. Z use: each character is mapped to exactly one other character. The mapping is a bijection — it is one-to-one (each plaintext character corresponds to exactly one ciphertext character) and onto (each ciphertext character corresponds to exactly one plaintext character).

Using the known plaintext/ciphertext pair, decrypt a second ciphertext message and help Ruby save the world.

Input

The input consists of three strings, one per line:

  • The first line is the plaintext message that Ruby already knows.
  • The second line is the ciphertext that corresponds to that plaintext (it has the same length as the first line).
  • The third line is a second ciphertext message that you must decrypt.

Every string has length between 1 and 80 characters. Only 27 characters are valid: the uppercase letters A through Z and the space character ( ). There are no lowercase letters, digits, punctuation, or other special characters.

Output

Print the plaintext string that corresponds to the third line (the second ciphertext).

Some characters of the third line may be impossible to determine, because the mapping for that ciphertext character never appears in the known plaintext/ciphertext pair. For every such character, print a period (.) in its place.