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

Difficulty: EASY
Tags: String algorithms

Implementation

Starter code:

Solutions:
s1 = input()
s2 = list(map(str, input()))
s3 = input()
s4 = ''
index = 0
for i in s3:
	s = ''
	if i.isupper():
		i = i.lower()
		index = s1.find(i)
		s = str(s2[index])
		s = s.upper()
		s4 += s
	elif i.islower():
		index = s1.find(i)
		s = str(s2[index])
		s = s.lower()
		s4 += s
	else:
		s4 += i
print(s4)


s = input()
t = input()
maps = dict(zip(s, t))
decoded = ''
encoded = input()
for i in encoded:
	if i.lower() in maps:
		if i.isupper():
			decoded += maps[i.lower()].upper()
		else:
			decoded += maps[i.lower()]
	else:
		decoded += i
print(decoded)


def isLower(char):
	char2 = char.lower()
	if char == char2:
		return True
	else:
		return False

def indexOf(str, char):
	i = 0
	while i < len(str):
		if str[i] == char:
			return i
		i += 1
	return -1
str1 = input()
str2 = input()
str = input()
strToPrint = ''
i = 0
while i < len(str):
	char = str[i]
	islow = isLower(char)
	char = char.lower()
	index = indexOf(str1, char)
	if index == -1:
		new = char
		strToPrint += new
	else:
		new = str2[index]
		if islow:
			strToPrint += new
		else:
			strToPrint += new.upper()
	i += 1
print(strToPrint)


new = list(input())
ori = list(input())
s = input()
ans = ''
for c in s:
	if not c.isalpha():
		ans = ''.join((ans, c))
	elif c.isupper():
		c = c.lower()
		ans = ''.join((ans, ori[new.index(c)].upper()))
	else:
		ans = ''.join((ans, ori[new.index(c)]))
print(ans)


s = input()
d = input()
c = input()
e = []
f = c.lstrip()
f = f.lower()
for i in f:
	if i.isalpha():
		a = s.index(i)
		e.append(d[a])
	else:
		e.append(i)
for i in range(len(c)):
	if c[i].isupper():
		e[i] = e[i].upper()
print(''.join(e))


(f, s, b) = (input(), input(), input())
b2 = b.lower()
x = ''
for i in b2:
	for j in f:
		if i == j:
			x = x + s[f.index(i)]
		elif i.isdigit():
			x = x + i
			break
y = list(x)
for i in range(len(b)):
	if b[i].isupper():
		y[i] = y[i].upper() + ''
print(''.join(y))


import sys
rline = lambda : sys.stdin.readline()

def CF831B(lay1dict, lay2, msg):
	ans = ''
	for i in msg:
		if not i.isalpha():
			ans += i
		elif i.lower() != i:
			ans += lay2[lay1dict[i.lower()]].upper()
		else:
			ans += lay2[lay1dict[i.lower()]]
	return ans
lay1 = rline()
lay1dict = {lay1[x]: x for x in range(len(lay1))}
lay2 = rline()
msg = rline()
print(CF831B(lay1dict, lay2, msg))


s1 = input()
s2 = input()
res = input()
str = ''
l = []
l1 = []
for i in s1:
	l.append(i)
for i in s2:
	l1.append(i)
for i in res:
	if i >= '0' and i <= '9':
		str = str + i
	elif i >= 'A' and i <= 'Z':
		n = l.index(i.lower())
		str = str + l1[n].upper()
	else:
		n = l.index(i)
		str = str + l1[n]
print(str)


keyboard1 = input()
keyboard2 = input()
text = input()
new_text = str()
for i in range(len(text)):
	new_char = text[i]
	if text[i].isalpha():
		new_char = keyboard2[keyboard1.index(text[i].lower())]
		if text[i].isupper():
			new_char = new_char.upper()
	new_text += new_char
print(new_text)


a = input()
b = input()
c = input()
for i in c:
	if ord(i) < 65:
		print(i, end='')
	elif ord(i) > 64 and ord(i) < 91:
		k = chr(ord(i) + 32)
		print(chr(ord(b[a.find(k)]) - 32), end='')
	else:
		print(b[a.find(i)], end='')


original_layout = input()
fake_layout = input()
string = input()
output = ''
layout_len = len(original_layout)
for char in string:
	if ord(char) in range(65, 91):
		char = char.lower()
		for i in range(layout_len):
			if char == original_layout[i]:
				output += fake_layout[i].upper()
				break
	elif ord(char) in range(97, 123):
		for i in range(layout_len):
			if char == original_layout[i]:
				output += fake_layout[i]
				break
	else:
		output += char
print(output)


i = list(input())
o = list(input())
ii = {}
for (idx, val) in enumerate(i):
	ii[val] = o[idx]
	ii[chr(ord(val) - (ord('a') - ord('A')))] = chr(ord(o[idx]) - (ord('a') - ord('A')))
req = list(input())
for each in req:
	if each in ii:
		print(ii[each], end='')
	else:
		print(each, end='')


import sys
s1 = input()
s2 = input()
s3 = input()
store1 = [0] * 26
for i in range(26):
	pos = ord(s1[i]) - 97
	val = ord(s2[i]) - 97
	store1[pos] = val
s4 = ''
for i in range(len(s3)):
	if 48 <= ord(s3[i]) and ord(s3[i]) <= 57:
		s4 += s3[i]
	elif 65 <= ord(s3[i]) and ord(s3[i]) <= 90:
		pos = ord(s3[i]) - 65
		s4 += chr(store1[pos] + 65)
	else:
		pos = ord(s3[i]) - 97
		s4 += chr(store1[pos] + 97)
print(s4)


s1 = input()
s2 = input()
s = input()
d1 = {}
d2 = {}
s_new = ''
for i in range(26):
	d1[s1[i]] = s2[i]
s1 = s1.upper()
s2 = s2.upper()
for j in range(26):
	d2[s1[j]] = s2[j]
s1 = s1.lower()
s2 = s2.lower()
for k in range(len(s)):
	try:
		if s[k].isupper():
			s_new += d2[s[k]]
		else:
			s_new += d1[s[k]]
	except KeyError:
		s_new += s[k]
print(s_new)


a = input()
b = input()
c = input()
A = a.upper()
B = b.upper()
a += A
b += B
x = ''
d = {a[i]: b[i] for i in range(len(a))}
for i in c:
	if not i.isdigit():
		x += d[i]
	else:
		x += i
print(x)


a = list(input())
b = list(input())
s = input()
for i in range(len(s)):
	if s[i].islower():
		n = a.index(s[i])
		print(b[n], end='')
	elif s[i].isupper():
		n = a.index(s[i].lower())
		print(b[n].upper(), end='')
	else:
		print(s[i], end='')


first = [i for i in input()]
firstup = [i.upper() for i in first]
second = [i for i in input()]
secondup = [i.upper() for i in second]
third = [i for i in input()]
s = ''
for i in third:
	if i in first:
		s += second[first.index(i)]
	elif i in firstup:
		s += secondup[firstup.index(i)]
	else:
		s += i
print(s)


first_ras = input()
second_ras = input()
end_str = input()
temp_str = ''
for letter in end_str:
	if letter.isupper():
		letter = letter.lower()
		index_in_first_ras = first_ras.find(letter)
		temp_str += second_ras[index_in_first_ras].upper()
	else:
		index_in_first_ras = first_ras.find(letter)
		if index_in_first_ras == -1:
			temp_str += letter
		else:
			temp_str += second_ras[index_in_first_ras]
print(temp_str)


first = input()
second = input()
s = input()
len = len(s)
for i in range(len):
	if 48 <= ord(s[i]) and ord(s[i]) <= 57:
		to_print = s[i]
	else:
		offset = 0
		if 65 <= ord(s[i]) and ord(s[i]) <= 90:
			offset = 32
		pos = first.index(chr(ord(s[i]) + offset))
		from_second = chr(ord(second[pos]) - offset)
		to_print = from_second
	print(to_print, end='')


l1 = input()
p = '1234567890'
l2 = input()
l1 += p
l2 += p
n = list(input())
k = []
d = []
for i in range(len(n)):
	if n[i] <= 'Z' and n[i] >= 'A':
		n[i] = n[i].lower()
		k.append(i)
	p = l1.index(n[i])
	d.append(l2[p])
for i in k:
	d[i] = d[i].upper()
d = ''.join(d)
print(d)


lay1 = input()
lay2 = input()
convert = {}
for i in range(0, 26):
	convert.update({lay1[i]: lay2[i]})
original_word = input()
word = original_word.lower()
op = []
for i in range(0, len(word)):
	if word[i] in convert.keys():
		if original_word[i].isupper():
			op.append(convert[word[i].lower()].upper())
		else:
			op.append(convert[word[i]])
	else:
		op.append(word[i])
op = ''.join(op)
print(op)


first = str(input())
second = str(input())
text = str(input())
firstIndex = []
secondIndex = []
for i in range(26):
	firstIndex.append(first.index(chr(i + 97)))
for i in range(26):
	secondIndex.append(second.index(chr(i + 97)))
for i in text:
	if ord(i) < 65:
		print(i, end='')
	elif ord(i) >= 65 and ord(i) <= 90:
		print(chr(ord(second[firstIndex[ord(i) - 65]]) - 32), end='')
	elif ord(i) >= 97 and ord(i) <= 122:
		print(second[firstIndex[ord(i) - 97]], end='')


a = input()
b = input()
c = input()
d = ''
for k in c:
	if k.isdigit():
		d += str(k)
	elif k.isupper():
		d += b[a.index(k.lower())].upper()
	else:
		d += b[a.index(k)]
print(d)


a = input()
b = input()
c = input()
s = ''
for i in range(len(c)):
	if c[i].isdigit():
		s += c[i]
	else:
		w = ord(c[i])
		if w < 96:
			q = a.find(c[i].lower())
			s += b[q].upper()
		else:
			q = a.find(c[i])
			s += b[q]
print(s)


s1 = input().lower()
s2 = input().lower()
d = {}
for i in range(len(s1)):
	d[s1[i]] = s2[i]
s1 = s1.upper()
s2 = s2.upper()
for i in range(len(s1)):
	d[s1[i]] = s2[i]
inp = input()
ans = ''
for x in inp:
	if x in d:
		ans = ans + d[x]
	else:
		ans = ans + x
print(ans)


import math
a = str(input())
b = str(input())
c = str(input())
t = ''
for i in range(0, len(c)):
	if c[i] == '1' or c[i] == '2' or c[i] == '3' or (c[i] == '4') or (c[i] == '5') or (c[i] == '6') or (c[i] == '7') or (c[i] == '8') or (c[i] == '9') or (c[i] == '0'):
		t = t + c[i]
	for j in range(0, len(b)):
		if c[i].lower() == a[j].lower() and c[i] == c[i].lower():
			t = t + b[j]
		if c[i].lower() == a[j].lower() and c[i] != c[i].lower():
			t = t + b[j].upper()
print(t)


a = list(input())
b = list(input())
d = dict(zip(a, b))
z = list(input())
for i in range(len(z)):
	if z[i].isalpha() == 1:
		if z[i].islower() == 1:
			print(d[z[i].lower()], end='')
		else:
			print(d[z[i].lower()].upper(), end='')
	else:
		print(z[i], end='')


s1 = input()
s2 = input()
d = {}
for i in range(26):
	d[s1[i]] = s2[i]
	d[chr(ord(s1[i]) - 32)] = chr(ord(s2[i]) - 32)
s = input()
for i in s:
	try:
		print(d[i], end='')
	except:
		print(i, end='')
print()


s = input()
S = s.upper()
t = input()
T = t.upper()
x = input()
y = ''
for i in x:
	if i in s:
		y += t[s.index(i)]
	elif i in S:
		y += T[S.index(i)]
	else:
		y += i
print(y)


s1 = list(input())
s2 = list(input())
s3 = list(input())
count = 0
for i in range(len(s3)):
	if s3[i].isupper():
		w = s3[i].lower()
		s = s1.index(w)
		q = s2[s]
		z = q.upper()
		print(z, end='')
	elif s3[i].islower():
		s = s1.index(s3[i])
		q = s2[s]
		print(q, end='')
	else:
		print(s3[i], end='')


(a, b, c) = (input(), input(), input())
map = {}
for ind in range(len(b)):
	map[ind] = b[ind]
ans = ''
for letter in c:
	found = False
	for ind in range(len(a)):
		if letter == a[ind]:
			ans += map[ind]
			found = True
			break
		elif letter.lower() == a[ind]:
			ans += map[ind].upper()
			found = True
			break
	if found == False:
		ans += letter
print(ans)


(s1, s2) = (input(), input())
print(input().translate(str.maketrans(s1 + s1.upper(), s2 + s2.upper())))


s = input()
t = input()
u = {s[i]: t[i] for i in range(26)}
y = input()
p = ''
for i in range(len(y)):
	if y[i].lower() not in u:
		p += y[i]
	elif y[i] == y[i].upper():
		p += u[y[i].lower()].upper()
	else:
		p += u[y[i]]
print(p)


s1 = input().lower()
s2 = input().lower()
s3 = input()
dict1 = {}
for i in range(0, 26):
	dict1[s1[i]] = s2[i]
for i in s3:
	nk = 0
	j = i.lower()
	try:
		a = dict1[j]
	except:
		nk = 1
		print(i, end='')
	if nk == 0:
		if ord(i) >= 97:
			print(dict1[i], end='')
		else:
			print(dict1[j].upper(), end='')
print()


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	s = input()
	t = input()
	G = {}
	for (a, b) in zip(s, t):
		G[a] = b
	x = input()
	A = []
	for a in x:
		if a.isdigit():
			A.append(a)
		else:
			is_upper = a.isupper()
			a = a.lower()
			a = G[a]
			if is_upper:
				a = a.upper()
			A.append(a)
	print(''.join(A))

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


(layout1, layout2) = (input(), input())
m = dict(zip(layout1 + layout1.upper(), layout2 + layout2.upper()))
s = input()
result = [m[ch] if ch.isalpha() else ch for ch in s]
print(''.join(result))


a = input()
b = input()
d = {}
for i in range(26):
	d[a[i]] = b[i]
	d[a[i].upper()] = b[i].upper()
out = []
for c in input():
	if c.isnumeric():
		out.append(c)
	else:
		out.append(d[c])
print(''.join(out))


a = input()
b = input()
s = input()
A = a.upper()
B = b.upper()
for x in s:
	c = x
	if x in a:
		c = b[a.index(x)]
	elif x in A:
		c = B[A.index(x)]
	print(c, end='')


a = input()
b = input()
c = input()
x = 'abcdefghijklmnopqrstuvwxyz'
y = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
rez = ''
(di, d1, d2) = ({}, {}, {})
for (i, u) in enumerate(a):
	di[u] = b[i]
	d1[y[i]] = x[i]
	d2[x[i]] = y[i]
for (i, k) in enumerate(c):
	if '0' <= k <= '9':
		rez += k
		continue
	(r, l) = ('', '')
	if 'A' <= k <= 'Z':
		rez += d2[di[d1[k]]]
	else:
		rez += di[k]
print(rez)


x = input()
y = input()
z = input()
s = ''
l1 = list(x)
l2 = list(y)
p = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(z)):
	if z[i] in l1 or z[i] in p:
		if z[i].isupper():
			w = z[i].lower()
			s = s + l2[l1.index(w)].upper()
		else:
			s = s + l2[l1.index(z[i])]
	else:
		s = s + z[i]
print(s)


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 5
T = 1
for _ in range(T):
	a = list(stdin.readline().strip('\n'))
	b = list(stdin.readline().strip('\n'))
	q = list(stdin.readline().strip('\n'))
	d = {}
	for i in range(26):
		d[a[i]] = b[i]
		d[a[i].upper()] = b[i].upper()
	for i in q:
		if i not in d:
			print(i, end='')
		else:
			print(d[i], end='')


from sys import stdin
s1 = stdin.readline().rstrip()
s2 = stdin.readline().rstrip()
ss = stdin.readline().rstrip()
data = {}
for i in range(0, len(s1)):
	data[s1[i]] = s2[i]
	data[s1[i].upper()] = s2[i].upper()
rs = []
for i in ss:
	rs.append(data[i] if i in data else i)
print(''.join(rs))


l1 = input()
l2 = input()
text = input()
text2 = []
for i in text:
	if i.isalpha():
		cur = l2[l1.find(i.lower())]
		if i.islower():
			text2.append(cur)
		else:
			text2.append(cur.upper())
	else:
		text2.append(i)
print(''.join(text2))


l1 = list(input().strip()[:26])
l2 = list(input().strip()[:26])
s = list(input().strip())
for x in range(len(s)):
	if s[x].isalpha() == True:
		if s[x].isupper() == True:
			k = l2[l1.index(s[x].lower())]
			s[x] = k.upper()
		else:
			s[x] = l2[l1.index(s[x])]
print(''.join(map(str, s)))


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()
alf2 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def main():
	s = list(S())
	t = list(S())
	x = S()
	ans = ''
	for y in x:
		if y in list('0123456789'):
			ans += y
			continue
		f = False
		if y in alf2:
			f = True
		if f:
			yy = alf[alf2.index(y)]
		else:
			yy = y
		ind = s.index(yy)
		a = t[ind]
		if f:
			a = alf2[alf.index(a)]
		ans += a
	return ans
print(main())


def keyboard_layouts(a, b, c):
	if a is None or b is None or c is None:
		return None
	search = c.lower()
	for i in range(len(search)):
		if search[i].isdigit():
			print(search[i], end='')
		else:
			x = a.find(search[i])
			if c[i].isupper():
				print(b[x].upper(), end='')
			else:
				print(b[x], end='')
keyboard_layouts(str(input()), str(input()), str(input()))


s = input()
key = input()
message = input()
hmap = {s[i]: key[i] for i in range(len(s))}
for i in message:
	if i.isupper():
		print(hmap[i.lower()].upper(), end='')
	elif hmap.get(i) != None:
		print(hmap[i], end='')
	else:
		print(i, end='')


a = input()
b = input()
a += a.upper()
b += b.upper()
z = dict(zip(a, b))
for i in input():
	if i in z:
		print(z[i], end='')
	else:
		print(i, end='')


string1 = input()
string2 = input()
convert = input()
con = {}
count = 0
for x in string1:
	con[x] = string2[count]
	count += 1
temp = ''
for x in convert:
	if x.lower() in con:
		if x.islower():
			temp = temp + con[x]
		else:
			temp = temp + con[x.lower()].upper()
	else:
		temp = temp + x
print(temp)


import sys
layout1 = sys.stdin.readline()
layout2 = sys.stdin.readline()
text = sys.stdin.readline()
conversion = {}
for (i, c) in enumerate(layout1 + layout1.upper()):
	conversion[c] = (layout2 + layout2.upper())[i]
print(''.join([conversion[c] if c.isalpha() else c for c in text]))


from sys import stdin, stdout
first = stdin.readline().strip()
second = stdin.readline().strip()
s = stdin.readline().strip()
translate = {}
for i in range(len(first)):
	translate[first[i]] = second[i]
	translate[first[i].upper()] = second[i].upper()
for f in s:
	if 'z' >= f >= 'a' or 'Z' >= f >= 'A':
		stdout.write(translate[f])
	else:
		stdout.write(f)


s1 = input()
s2 = input()
s = input()
l = len(s1)
d = dict()
for i in range(l):
	d[s1[i]] = s2[i]
	d[chr(ord(s1[i]) - 32)] = chr(ord(s2[i]) - 32)
l2 = len(s)
s3 = ''
for i in s:
	if i in d:
		s3 += d[i]
	else:
		s3 += i
print(s3)


k1 = input()
k2 = input()
s = input()
str = ''
l = len(s)
for i in range(l):
	if s[i].isalpha():
		for j in range(26):
			if s[i].lower() == k1[j]:
				if s[i].isupper():
					str += k2[j].upper()
				else:
					str += k2[j]
				break
	else:
		str += s[i]
print(str)


r1 = input()
ru1 = r1.upper()
r2 = input()
ru2 = r2.upper()
s = input()
ans = ''
for x in s:
	i = r1.find(x)
	iu = ru1.find(x)
	if i == -1 and iu == -1:
		ans += x
	elif i == -1:
		ans += ru2[iu]
	else:
		ans += r2[i]
print(ans)


l1 = input()
l2 = input()
s = input()
r = ''
for i in s:
	if i.isalpha():
		a = l1.find(i.lower())
		if i.isupper():
			r += l2[a].upper()
		else:
			r += l2[a]
	else:
		r += i
print(r)


from string import digits
first = input()
second = input()
incorrect = input()
association = {}
for (f, s) in zip(first, second):
	association[f.lower()] = s.lower()

def decode(string):
	answer = []
	for i in range(len(string)):
		cur_symbol = string[i]
		if cur_symbol in digits:
			answer.append(cur_symbol)
		elif cur_symbol.isupper():
			answer.append(association[cur_symbol.lower()].upper())
		else:
			answer.append(association[cur_symbol])
	return ''.join(answer)
print(decode(incorrect))


first = input()
second = input()
text = input()
result = ''
for i in text:
	if i.isdigit():
		result += i
	elif i.isalpha():
		if i.upper() == i:
			coord = first.index(i.lower())
			result += second[coord].upper()
		else:
			coord = first.index(i.lower())
			result += second[first.index(i)].lower()
print(result)


def main():
	(a, b, c) = (input() for _ in 'abc')
	print(c.translate(str.maketrans(a + a.upper(), b + b.upper())))
main()


layout1 = input()
layout2 = input()
message = input()
ind = 0
upper = False
new_message = ''
for c in message:
	ind = layout1.find(c)
	if ind == -1:
		if c.isupper() == True:
			ind = layout1.find(c.lower())
			new_message += layout2[ind].upper()
		else:
			new_message += c
	else:
		new_message += layout2[ind]
print(new_message)


s1 = input()
s2 = input()
s3 = input()
s4 = s3.lower()
j = 0
s5 = ''
for i in s4:
	if s4[j].isdigit():
		s5 += s4[j]
		j += 1
		continue
	s = s4[j]
	posi = s1.find(s)
	if posi >= 0:
		if s3[j].isupper():
			s5 += s2[posi].upper()
		else:
			s5 += s2[posi]
		j += 1
print(s5)


fLayout = input()
sLayout = input()
inputString = input()
fLayout_IndexToKey = {}
for i in range(len(fLayout)):
	fLayout_IndexToKey[fLayout[i]] = i
result = ''
for i in range(len(inputString)):
	lowerCase = inputString[i].lower()
	if not lowerCase in fLayout:
		result += inputString[i]
	elif not inputString[i].islower():
		result += sLayout[fLayout_IndexToKey[lowerCase]].upper()
	else:
		result += sLayout[fLayout_IndexToKey[lowerCase]]
print(result)


I = input
(A, B) = (I(), I())
print(I().translate(''.maketrans(A + A.upper(), B + B.upper())))


layout1 = input()
layout2 = input()
line = input()
answer = ''
for i in line:
	a = 0
	if i.isupper():
		a = 1
		i = i.lower()
	if i not in layout1:
		answer += i
		continue
	ind = layout1.index(i)
	k = layout2[ind]
	if a:
		answer += k.upper()
	else:
		answer += k
print(answer)


import sys
import collections

def input():
	return sys.stdin.readline().rstrip('\r\n')

def List():
	return list(map(int, input().split()))

def Num():
	return int(input())
a = input().lower()
b = input().lower()
after = input()
s = after.lower()
d = collections.defaultdict(lambda : '')
for i in range(len(a)):
	if a[i] not in d:
		d[a[i]] += b[i]
ans = ''
for i in s:
	if i.isdigit():
		ans += i
	else:
		ans += d[i]
new_ans = ''
for i in range(len(after)):
	if after[i].isupper():
		new_ans += chr(ord(ans[i]) - 32)
	else:
		new_ans += ans[i]
print(new_ans)


a = list(input())
d = {}
b = input()
for i in range(26):
	d[a[i]] = b[i]
c = input()
for i in c:
	if 'a' <= i <= 'z':
		print(d[i], end='')
	elif 'A' <= i <= 'Z':
		print(d[i.lower()].upper(), end='')
	else:
		print(i, end='')


import sys
data = sys.stdin.readlines()
a = data[0].strip()
b = data[1].strip()
c = data[2].strip()
ans = ''
for char in c:
	i = 0
	if char in a:
		while a[i] != char:
			i += 1
		ans += b[i]
	elif char in '0123456789':
		ans += char
	else:
		new = char.lower()
		while a[i] != new:
			i += 1
		ans += b[i].upper()
print(ans)


a = input()
b = input()
c = input()
k = ''
for i in range(len(c)):
	if not c[i].lower() in a:
		k = k + c[i]
	else:
		ch = b[a.find(c[i].lower())]
		if c[i] == c[i].upper():
			k = k + ch.upper()
		else:
			k = k + ch.lower()
print(k)


strori = input()
strano = input()
lori = {}
case = {}
for i in range(26):
	lori[strori[i]] = strano[i]
string = input()
ans = ''
for i in range(len(string)):
	if string[i].isdigit():
		ans += string[i]
	else:
		low = string[i].lower()
		ans += lori[low].upper() if string[i].isupper() else lori[low]
print(ans)


def int_map():
	return map(int, input().split(' '))
s1 = input()
s1 += s1.upper()
s2 = input()
s2 += s2.upper()
alf = {a: b for (a, b) in zip(s1, s2)}
s = input()
res = ''
for i in s:
	if i in alf:
		res += alf[i]
	else:
		res += i
print(res)


a = input()
b = input()
s = input()
d = {}
for i in range(26):
	d[a[i]] = b[i]
	d[a[i].capitalize()] = b[i].capitalize()
out = ''
ks = d.keys()
for i in range(len(s)):
	if s[i] in ks:
		out += d[s[i]]
	else:
		out += s[i]
print(out)


en = input()
br = input()
sentence = input()
alph = {}
for index in range(len(en)):
	alph[en[index]] = br[index]
	alph[en[index].upper()] = br[index].upper()
res = ''
for char in sentence:
	if char.isnumeric():
		res += str(char)
		continue
	res += alph[char]
print(res)


s1 = input()
s2 = input()
d = {}
for i in range(len(s1)):
	d[s1[i]] = s2[i]
for i in input():
	if i.isupper():
		print(d[i.lower()].upper(), end='')
	elif i.islower():
		print(d[i], end='')
	else:
		print(i, end='')


l1 = input()
l2 = input()
d12 = {l1[i]: l2[i] for i in range(26)}
trl = input()
for i in trl:
	if i.isupper():
		t = i.lower()
		print(d12[t].upper(), end='')
	elif i.islower():
		print(d12[i], end='')
	else:
		print(i, end='')


s1 = input()
s2 = input()
t = input()
ans = ''
for i in range(len(t)):
	c = 0
	for j in range(len(s1)):
		if t[i].lower() == s1[j]:
			c = 1
			if ord(t[i]) >= 97:
				ans = ans + s2[j].lower()
			else:
				ans = ans + s2[j].upper()
			break
	if c == 0:
		ans = ans + t[i]
print(ans)


a = list(input())
b = list(input())
z = list(input())
n = len(z) * [0]
c = str()
for i in range(len(z)):
	if z[i].lower() in a:
		if z[i] == z[i].lower():
			n[i] = b[a.index(z[i].lower())]
		else:
			n[i] = b[a.index(z[i].lower())].upper()
	else:
		n[i] = z[i]
for j in range(len(n)):
	c += n[j]
print(c)


r1 = input()
r2 = input()
s = input()
sr = ''
si = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for i in range(len(s)):
	if s[i] in si:
		print(s[i], end='')
		continue
	if s[i] == s[i].upper():
		print(r2[r1.index(s[i].lower())].upper(), end='')
	else:
		print(r2[r1.index(s[i].lower())], end='')


(f, t, w) = (input(), input(), input())
dl = {f[_].lower(): t[_].lower() for _ in range(len(f))}
du = {f[_].upper(): t[_].upper() for _ in range(len(f))}
r = ''
for i in range(len(w)):
	if w[i] in dl:
		r += dl[w[i]]
	elif w[i] in du:
		r += du[w[i]]
	else:
		r += w[i]
print(r)


a = list(input())
b = list(input())
c = list(input())
d = []
for i in c:
	if i in a:
		d.append(b[a.index(i)])
	elif chr(ord(i) + 32) in a:
		d.append(chr(ord(b[a.index(chr(ord(i) + 32))]) - 32))
	else:
		d.append(i)
print(''.join(d))


(a, b, s) = (input(), input(), input())
print(s.translate(str.maketrans(a.lower() + a.upper(), b.lower() + b.upper())))


s = input()
p = input()
k = input()
l = ''
for i in k:
	if i >= 'a' and i <= 'z':
		t = s.index(i)
		l += p[t]
	elif i >= 'A' and i <= 'Z':
		t = s.index(i.lower())
		l += p[t].upper()
	else:
		l += i
print(l)


a = input()
b = input()
mapping = {}
for I in range(len(a)):
	mapping[a[I]] = b[I]
c = input()
answer = ''
for I in c:
	if I.isupper():
		answer += mapping[I.lower()].upper()
	elif I.islower():
		answer += mapping[I]
	else:
		answer += I
print(answer)


def isdigit(c):
	return c >= '0' and c <= '9'
first = input()
second = input()
text = input()
d = dict()
for i in range(26):
	d[first[i]] = second[i]
	d[first[i].upper()] = second[i].upper()
for x in text:
	if isdigit(x):
		print(x, end='')
	else:
		print(d[x], end='')


import sys
fin = sys.stdin
fout = sys.stdout
layout1 = fin.readline()
layout2 = fin.readline()
layout1_char2num = {c: i for (i, c) in enumerate(layout1)}
layout2_num2char = {i: c for (i, c) in enumerate(layout2)}
s = fin.readline()
res = ''
for c in s:
	if c.lower() in layout1_char2num:
		new_symbol = layout2_num2char[layout1_char2num[c.lower()]]
		if c.lower() == c:
			res += new_symbol
		else:
			res += new_symbol.upper()
	else:
		res += c
fout.write(res)
fout.close()


t = input()
type1 = {}
for (i, c) in enumerate(t):
	type1[c] = i
t = input()
type2 = {}
for (i, c) in enumerate(t):
	type2[str(i)] = c
string = input()
result = []
for c in string:
	if c.isalpha():
		l = c.lower()
		number = type1[l]
		letter = type2[str(number)]
		if c.isupper():
			letter = letter.upper()
		result.append(letter)
	else:
		result.append(c)
print(''.join(result))


from sys import stdin
input = lambda : stdin.readline().strip()
s = input()
t = input()
c = input()
p = ''
sn = {j: i for (i, j) in enumerate(s)}
tc = {i: j for (i, j) in enumerate(t)}
for i in c:
	if i.islower():
		p += tc[sn[i]]
	elif i.isupper():
		p += tc[sn[i.lower()]].upper()
	else:
		p += i
print(p)


a = input()
b = input()
c = input()
m = {}
for i in range(26):
	m[a[i]] = b[i]
	m[a[i].upper()] = b[i].upper()
for i in c:
	if i in m:
		print(m[i], end='')
	else:
		print(i, end='')
print()


ch = input()
ch2 = input()
text = input()
l = []
l1 = []
l2 = []
l3 = []
for i in range(len(ch)):
	l.append(ch[i])
	l1.append(ch2[i])
n = len(l)
for lettre in text:
	i = 0
	if lettre.isdigit():
		l3.append(lettre)
	while i < n:
		if lettre.isupper():
			if lettre == l[i].upper():
				l3.append(l1[i].upper())
		elif lettre == l[i]:
			l3.append(l1[i])
		i += 1
for lettre in l3:
	print(lettre, end='')


first = input().lower()
second = input().lower()
string = input()
s = string.lower()
new_str = ''
for i in range(len(s)):
	if s[i].isdigit():
		new_str += s[i]
	elif string[i].isupper():
		new_str += second[first.index(s[i])].upper()
	else:
		new_str += second[first.index(s[i])].lower()
print(new_str)


n = input()
n1 = input()
n2 = input()
m = ''
v = ''
s = n2.lower()
for i in s:
	if ord(i) >= ord('a') and ord(i) <= ord('z'):
		m = m + n1[n.index(i)]
	else:
		m = m + i
for j in range(len(n2)):
	if n2[j].isupper() == True:
		b = m[j].upper()
		v += b
	else:
		v += m[j]
print(v)


from string import ascii_lowercase as low
from string import ascii_uppercase as up
start = input()
end = input()
s = input()
out = []
for c in s:
	if c in up:
		out.append(end[start.index(c.lower())].upper())
	elif c in low:
		out.append(end[start.index(c)])
	else:
		out.append(c)
print(''.join(out))


fir = list(map(str, input().strip()))
sec = list(map(str, input().strip()))
string = list(map(str, input().strip()))
ans = ''
l = {}
for i in range(26):
	l[fir[i]] = sec[i]
for i in string:
	if i.islower():
		ans += l[i]
	elif i.isupper():
		ans += l[i.lower()].upper()
	else:
		ans += i
print(ans)


dic = {}
first_layout = list(input())
second_layout = list(input())
l = len(first_layout)
for i in range(l):
	dic[first_layout[i]] = second_layout[i]
	dic[chr(ord(first_layout[i]) - 32)] = chr(ord(second_layout[i]) - 32)
typed = list(input())
for c in typed:
	if dic.get(c) == None:
		print(c, end='')
	else:
		print(dic[c], end='')


a = input()
b = input()
c = input()
x = ''
for i in c:
	if i == i.upper():
		i = i.lower()
		if i not in a:
			x += i
		else:
			x += b[a.index(i)].upper()
	elif i not in a:
		x += i
	else:
		x += b[a.index(i)]
print(x)


first_layout = input()
second_layout = input()
translated_message = ''
for c in input():
	if c.isnumeric():
		translated_message += c
	elif not c.islower():
		c = c.lower()
		translated_message += second_layout[first_layout.find(c)].capitalize()
	else:
		translated_message += second_layout[first_layout.find(c)]
print(translated_message)


fl = list(input())
sl = list(input())
s = input()
typed_in_second = ''
for char in s:
	if char != char.lower():
		isUpper = True
	else:
		isUpper = False
	char = char.lower()
	if char in fl:
		index = fl.index(char)
		typed_in_second += sl[index] if not isUpper else sl[index].upper()
	else:
		typed_in_second += char
print(typed_in_second)


b = input().split()[0]
a = input().split()[0]
quest = input().split()[0]
ans = ''
for elem in quest:
	if elem.isalpha():
		if elem.istitle():
			ans += chr(ord(a[b.index(elem.lower())]) + ord('A') - ord('a'))
		else:
			ans += a[b.index(elem)]
	else:
		ans += elem
print(ans)


layout1 = input()
layout2 = input()
inputString = input()
dict = {}
for i in range(len(layout1)):
	dict[layout1[i]] = layout2[i]
	dict[chr(ord(layout1[i]) - 32)] = chr(ord(layout2[i]) - 32)
for ch in inputString:
	print(dict.get(ch, ch), end='')


(layout1, layout2) = (str(input()), str(input()))
text = str(input())
for j in range(len(text)):
	if ord(text[j]) >= 48 and ord(text[j]) <= 57:
		print(end=text[j])
		continue
	index = layout1.index(text[j].lower())
	if text[j] == text[j].upper():
		print(end=layout2[index].upper())
	else:
		print(end=layout2[index])


a = input()
b = input()
c = input()
dic = {}
for i in range(len(a)):
	dic[a[i]] = b[i]
for i in range(len(c)):
	if c[i].islower():
		print(dic[c[i]], end='')
	elif c[i].isupper():
		print(dic[c[i].lower()].upper(), end='')
	else:
		print(c[i], end='')


a = input()
b = input()
s = input()
d = {}
for i in range(26):
	d[a[i]] = b[i]
	d[a[i].upper()] = b[i].upper()
print(''.join([d[c] if c in d else c for c in s]))


l1 = input()
l2 = input()
word_in_l1 = input()
layout1 = l1 + l1.upper()
layout2 = l2 + l2.upper()
print(''.join([layout2[layout1.index(i)] if i in layout1 else i for i in word_in_l1]))


a1 = input().lower()
a2 = input().lower()
ss = input()
s = ss.lower()
for i in range(len(ss)):
	ch = s[i]
	if ch.isdigit():
		print(ch, end='')
		continue
	index = a1.index(ch)
	if ss[i].isupper():
		print(a2[index].upper(), end='')
	else:
		print(a2[index], end='')


s1 = input()
s2 = input()
s3 = input()
s4 = ''
di = {}
a = 0
for i in s1:
	di[i] = a
	a = a + 1
for i in s3:
	if i.isdigit():
		s4 = s4 + i
	elif i.islower():
		b = di[i]
		s4 = s4 + s2[b]
	else:
		b = di[i.lower()]
		s4 = s4 + s2[b].upper()
print(s4)


s = input()
a = list(s)
s.lower()
t = input()
b = list(t)
t.lower()
k = input()
w = list(k)
q = k.lower()
l = ''
for i in range(0, len(k)):
	d = q[i]
	if d in s:
		h = a.index(d)
		if ord(w[i]) >= 97 and ord(w[i]) <= 122:
			l += b[h].lower()
		else:
			l += b[h].upper()
	else:
		l += d
print(l)


a = input()
b = input()
c = input()
d = dict(((a[i], b[i]) for i in range(0, len(a))))
s = ''
for _ in c:
	if _.isupper():
		_ = d[_.lower()].upper()
	elif _.islower():
		_ = d[_]
	s += _
print(s)


x1 = input()
x2 = input()
y = input()
dic = {}
for i in range(26):
	dic[x1[i]] = x2[i]
s = ''
for i in y:
	if i.lower() in dic:
		if i.islower():
			s += dic[i]
		else:
			s += dic[i.lower()].upper()
	else:
		s += i
print(s)


x = input()
y = input()
s = input()
l = []
n = len(s)
for i in range(n):
	if s[i] >= 'A' and s[i] <= 'Z':
		t = chr(ord(s[i]) + 32)
		for j in range(26):
			if t == x[j]:
				l.append(chr(ord(y[j]) - 32))
				break
	elif s[i] >= 'a' and s[i] <= 'z':
		for j in range(26):
			if s[i] == x[j]:
				l.append(y[j])
				break
	else:
		l.append(s[i])
print(''.join(l))


d = dict()
tr = dict()
alpha = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
for i in range(26):
	tr[alpha[2 * i + 1]] = alpha[2 * i]
r1 = input()
r2 = input()
for s in range(26):
	d[r1[s]] = r2[s]
	d[tr[r1[s]]] = tr[r2[s]]
text = input()
ans = ''
for i in text:
	if i in d.keys():
		ans += d[i]
	else:
		ans += i
print(ans)


r = input()
r1 = input()
d = {}
for i in range(26):
	d[r[i]] = r1[i]
	d[r[i].upper()] = r1[i].upper()
w = input()
ans = ''
for i in w:
	if i.isalpha():
		ans = ans + d[i]
	else:
		ans = ans + i
print(ans)


def isConvertible(s):
	while True:
		try:
			int(s)
			return True
		except ValueError:
			return False

def FindPos(item, p):
	for i in range(len(p)):
		if item.lower() == p[i] or item.upper() == p[i]:
			return i
	return 0

def solve(s1, s2, s3):
	r = ''
	for x in s3:
		if isConvertible(x):
			r += x
		elif x.lower() == x:
			r += s2[FindPos(x, s1)].lower()
		elif x.upper() == x:
			r += s2[FindPos(x, s1)].upper()
	return r
S1 = input()
S2 = input()
S3 = input()
print(solve(S1, S2, S3))


p = list(input())
q = list(input())
r = list(input())
w = ''
for i in range(len(r)):
	if ord(r[i]) >= 97 and ord(r[i]) <= 122:
		w += q[p.index(r[i])]
	elif ord(r[i]) >= 65 and ord(r[i]) <= 90:
		w += q[p.index(r[i].lower())].upper()
	else:
		w += r[i]
print(w)


def equi(e, a, b):
	for k in range(26):
		if a[k] == e:
			return b[k]
			break
		elif a[k].upper() == e:
			return b[k].upper()
			break
	return e
a = str(input())
b = str(input())
c = str(input())
char = ''
for k in range(len(c)):
	r = equi(c[k], a, b)
	char = char + str(r)
print(char)


p = input('')
P = p.upper()
s = input('')
S = s.upper()
r = input('')
arr = []
for i in range(0, 26):
	arr.append([p[i], s[i]])
for i in range(0, 26):
	arr.append([P[i], S[i]])
for i in range(0, len(r)):
	for j in range(0, 52):
		if r[i] == arr[j][0]:
			print(arr[j][1], end='')
			break
		elif 48 <= ord(r[i]) <= 57:
			print(r[i], end='')
			break


s = input()
s2 = input()
s3 = input()
s4 = ''
for i in s3:
	if i.isalpha() == False:
		s4 += i
		continue
	k = s.find(i.lower())
	z = s2[k]
	if i >= 'a' and i <= 'z':
		s4 += z
	else:
		s4 += z.upper()
print(s4)


s1 = input()
s2 = input()
d = {}
for i in range(26):
	d[s1[i]] = s2[i]
c = input()
for i in c:
	if ord(i) < 91 and ord(i) > 64:
		print(chr(ord(d[chr(ord(i) + 32)]) - 32), end='')
	elif i not in d:
		print(i, end='')
	else:
		print(d[i], end='')


s1 = list(input())
s2 = list(input())
s3 = list(input())
s4 = ''
for l in s3:
	if l.isdigit() == True:
		s4 += l
	else:
		is_upper = l.isupper()
		if is_upper == True:
			s4 += s2[s1.index(l.lower())].upper()
		else:
			s4 += s2[s1.index(l)]
print(s4)


x1 = input()
x2 = input()
s = input()
k1 = [i for i in x1]
k2 = [i for i in x2]
d = dict(zip(k1, k2))
l = []
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		p = chr(ord(i) + 32)
		q = ord(d[p]) - 32
		l.append(chr(q))
	elif ord(i) >= 97 and ord(i) <= 122:
		l.append(d[i])
	else:
		l.append(i)
print(''.join(l))


a = input()
b = input()
c = input()
l = {}
for i in range(26):
	l[a[i]] = b[i]
d = ''
for j in range(len(c)):
	if c[j].isalpha():
		if c[j].islower():
			d = d + l[c[j]]
		else:
			d = d + l[c[j].lower()].upper()
	else:
		d = d + c[j]
print(d)


s = input()
t = input()
a = input()
m = ''
for i in range(len(a)):
	if ord(a[i]) > 47 and ord(a[i]) < 58:
		m += a[i]
	elif a[i] == a[i].lower():
		m += t[s.index(a[i].lower())]
	else:
		m += t[s.index(a[i].lower())].upper()
print(m)


s1 = input()
s2 = input()
dictionary = {}
for i in range(26):
	dictionary[s1[i]] = s2[i]
	dictionary[chr(ord(s1[i]) - 32)] = chr(ord(s2[i]) - 32)
text = input()
text_n = []
for i in text:
	if i in dictionary:
		text_n.append(dictionary[i])
	else:
		text_n.append(i)
print(''.join(text_n))


(k1, k2) = (input(), input())

def t(ch):
	i = k1.find(ch.lower())
	return chr(ord(ch) + ord(k2[i]) - ord(k1[i])) if i >= 0 else ch
print(''.join(map(t, input())))


s1 = input()
s2 = input()
s = input()
d = ''
for i in range(len(s)):
	while True:
		try:
			d += s2[s1.index(s[i])]
			break
		except ValueError:
			while True:
				try:
					d += s2.upper()[s1.upper().index(s[i])]
					break
				except ValueError:
					d += s[i]
					break
			break
print(d)


first = input() + '0123456789'
second = input() + '0123456789'
text = input()
d = dict()
for i in range(36):
	d[first[i]] = second[i]
for letter in text:
	print(d.get(letter, d.get(letter.lower()).upper()), end='')


s1 = input()
s2 = input()
s3 = input()
mp = {}
for i in range(len(s1)):
	mp.update({s1[i]: s2[i]})
for i in s3:
	if ord('0') <= ord(i) <= ord('9'):
		print(i, end='')
	elif ord('A') <= ord(i) <= ord('Z'):
		print(chr(ord(mp[chr(ord(i) + 32)]) - 32), end='')
	else:
		print(mp[i], end='')


s1 = input()
s2 = input()
s = input()
mp = dict()
for i in range(26):
	mp[s1[i]] = s2[i]
	mp[s1[i].upper()] = s2[i].upper()
for ans in s:
	if not ans.isnumeric():
		print(mp[ans], end='')
	else:
		print(ans, end='')


a = input()
b = input()
c = input()
e = ''
numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
for i in range(len(c)):
	if c[i] in numbers:
		e += c[i]
	else:
		for j in range(len(a)):
			if c[i].isupper():
				if c[i].lower() == a[j]:
					e += b[j].upper()
			elif c[i] == a[j]:
				e += b[j]
print(e)


import math
a = input()
b = input()
c = input()
mapa = {str(): str()}
for i in range(0, a.__len__()):
	mapa[a[i]] = b[i]
for i in c:
	if not i.isalpha():
		print(i, end='')
	elif i.isupper():
		print(mapa[i.lower()].upper(), end='')
	else:
		print(mapa[i], end='')


n = input()
f = input()
g = input()
d = {}
for i in range(len(n)):
	d[n[i]] = f[i]
	d[n[i].upper()] = f[i].upper()
for i in g:
	if ord(i) >= 65 and ord(i) <= 90 or (ord(i) >= 97 and ord(i) <= 122):
		print(d[i], end='')
	else:
		print(i, end='')


lis1 = list(input())
lis2 = list(input())
text = list(input())
newtext = []
d = {}
for i in range(0, 26):
	d.update({lis1[i]: lis2[i]})
for i in text:
	if i >= '0' and i <= '9':
		newtext.append(i)
	elif i.isupper():
		newtext.append(d[i.lower()].upper())
	else:
		newtext.append(d[i])
res = ''.join(newtext)
print(res)


s1l = input()
s2l = input()
task = input()
s1u = s1l + s1l.upper()
s2u = s2l + s2l.upper()
arr = []
for i in range(52):
	arr.append(s1u[i])
for i in task:
	if arr.count(i) != 0:
		for j in range(52):
			if i == s1u[j]:
				print(s2u[j], end='')
	else:
		print(i, end='')


s = input()
t = input()
l = {}
for i in range(26):
	l[s[i]] = ord(t[i]) - ord(s[i])
ans = ''
for c in input():
	ans += chr(ord(c) + l.get(c.lower(), 0))
print(ans)


s = str(input())
s1 = str(input())
s2 = str(input())
n = len(s)
n1 = len(s1)
n2 = len(s2)
for i in range(n2):
	if s2[i].isupper():
		p = s.find(s2[i].lower())
		print(s1[p].upper(), end='')
	elif s2[i].islower():
		p = s.find(s2[i])
		print(s1[p], end='')
	else:
		print(s2[i], end='')


tr = {}
qw1 = input().strip()
qw2 = input().strip()
s = input().strip()
for i in range(len(qw1)):
	tr[qw1[i]] = qw2[i]
	tr[qw1[i].upper()] = qw2[i].upper()
for ch in s:
	if ch.isdigit():
		print(ch, end='')
	else:
		print(tr[ch], end='')
print()


(a, b, c) = (input(), input(), input())
dict = {}
a += a.upper()
b += b.upper()
for i in range(len(a)):
	dict[a[i]] = b[i]
for i in c:
	if i in a:
		print(dict[i], end='')
	else:
		print(i, end='')
print('\n')


import sys
l1 = list(input())
l2 = list(input())
s = list(input())
n = len(s)
for i in range(n):
	tmp = s[i].lower()
	try:
		index = l1.index(tmp)
		x = l2[index]
		if s[i].isupper():
			s[i] = x.upper()
		else:
			s[i] = x
	except:
		continue
print(''.join(s))


a = input()
b = input()
c = input()
for i in range(len(c)):
	if c[i] == '1' or c[i] == '2' or c[i] == '3' or (c[i] == '4') or (c[i] == '5') or (c[i] == '6') or (c[i] == '7') or (c[i] == '8') or (c[i] == '9') or (c[i] == '0'):
		print(c[i], end='')
	elif c[i].isupper() == False:
		print(b[a.index(c[i])], end='')
	else:
		print(b[a.index(c[i].lower())].upper(), end='')


s1 = input()
s2 = input()
s3 = input()
A = dict()
for i in range(26):
	A[s1[i]] = s2[i]
for i in range(len(s3)):
	if s3[i] in A:
		print(A[s3[i]], end='')
	elif ord(s3[i]) >= ord('0') and ord(s3[i]) <= ord('9'):
		print(s3[i], end='')
	else:
		b = chr(ord(s3[i]) - ord('A') + ord('a'))
		b2 = chr(ord(A[b]) + ord('A') - ord('a'))
		print(b2, end='')


import sys
import math
import bisect

def main():
	s = input()
	t = input()
	d = dict()
	for i in range(26):
		d[s[i]] = t[i]
		d[s[i].upper()] = t[i].upper()
	A = list(input())
	for i in range(len(A)):
		if A[i].isalpha():
			A[i] = d[A[i]]
	print(''.join(A))
main()


s = input()
a = input()
k = input()
for i in k:
	if i.isalpha():
		if i.isupper():
			print(a[s.find(i.lower())].upper(), end='')
		else:
			print(a[s.find(i)], end='')
	else:
		print(i, end='')


alpha1 = input()
alpha2 = input()
s = input()
n = len(s)
indices = [0 for i in range(26)]
for i in range(26):
	indices[ord(alpha1[i]) - ord('a')] = i
for i in range(n):
	if not s[i].isalpha():
		print(s[i], end='')
	elif ord('A') <= ord(s[i]) and ord(s[i]) <= ord('Z'):
		j = ord(s[i]) - ord('A')
		j = indices[j]
		l = alpha2[j]
		l = chr(ord(l) - ord('a') + ord('A'))
		print(l, end='')
	else:
		j = ord(s[i]) - ord('a')
		j = indices[j]
		l = alpha2[j]
		print(l, end='')
print('')


n = input()
a = input()
l = input()
d = dict()
for i in range(26):
	d[n[i]] = a[i]
for i in l:
	if i >= 'a' and i <= 'z':
		print(d[i], end='')
	elif i >= 'A' and i <= 'Z':
		print(d[i.lower()].upper(), end='')
	else:
		print(i, end='')


lay_1 = input()
lay_2 = input()
text = input()
db = {}
for i in range(len(lay_1)):
	db[lay_1[i]] = lay_2[i]
res = ''
for char in text:
	if char.isdigit():
		res += char
	elif char.islower():
		res += db[char]
	else:
		res += db[char.lower()].upper()
print(res)


a = str(input())
b = str(input())
s = str(input())
c = ''
k = 0
for i in range(len(s)):
	for g in range(len(a)):
		if ord(s[i]) + 32 == ord(a[g]):
			c += chr(ord(b[g]) - 32)
			k += 1
			break
		elif ord(s[i]) == ord(a[g]):
			c += b[g]
			k += 1
			break
	if k == 0:
		c += s[i]
	else:
		k = 0
print(c)


x = input()
y = input()
d = {}
for i in range(26):
	d[x[i].lower()] = y[i].lower()
z = input()
a = ''
for i in range(len(z)):
	if z[i] in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']:
		a += z[i]
	elif z[i].islower():
		a += d[z[i]]
	else:
		a += d[z[i].lower()].upper()
print(a)


x = input()
y = input()
z = input()
a = [i for i in range(len(z)) if ord(z[i]) > 64 and ord(z[i]) < 91]
b = list(map(lambda i: y[x.index(i)] if ord(i) >= 97 and ord(i) <= 122 else i, z.lower()))
for i in a:
	b[i] = b[i].capitalize()
print(*b, sep='')


layout1 = input()
layout2 = input()
s = input()
a = ''
for i in s:
	if i.isdigit():
		a += str(i)
	else:
		pos = layout1.index(i.lower())
		if i.isupper():
			a += layout2[pos].upper()
		else:
			a += layout2[pos]
print(a)


s1 = input()
s2 = input()
t = input()
for i in t:
	check = 0
	for j in range(26):
		if i == s1[j]:
			print(s2[j], end='')
			check = 1
		elif chr(ord(i) + 32) == s1[j]:
			print(chr(ord(s2[j]) - 32), end='')
			check = 1
	if check == 0:
		print(i, end='')


(alph, repl, inp) = (input(), input(), input())
result = ''
for letter in inp:
	try:
		a = repl[alph.index(letter.lower())]
	except ValueError:
		a = letter
	result += a.upper() if letter.isupper() else a
print(result)


s1 = input()
l1 = list(s1)
s2 = input()
l2 = list(s2)
s3 = input()
new = ''
for ele in s3:
	if ele.lower() in l1:
		index1 = l1.index(ele.lower())
		char = l2[index1]
		if ele.isupper():
			new += char.upper()
		else:
			new += char.lower()
	else:
		new += ele
print(new)


(a, b) = (input(), input())
d = {}
for n in range(10):
	d[str(n)] = str(n)
for l in range(26):
	d[a[l]] = b[l]
	d[a[l].upper()] = b[l].upper()
s = ''
for x in input():
	s += d[x]
print(s)


(n, m, a, b) = (input(), input(), input(), '')
for i in a:
	if i.lower() in n:
		if i.islower():
			b += m[n.index(i)]
		else:
			b += m[n.index(i.lower())].upper()
	else:
		b += i
print(b)


one = list(input())
two = list(input())
string = list(input())
translate = dict()
for i in range(26):
	translate[one[i]] = two[i]
for letter in string:
	up = False
	if letter.isupper():
		up = True
	if letter.lower() in translate.keys():
		new = translate[letter.lower()]
	else:
		new = letter
	if up is True:
		new = new.upper()
	print(new, end='')


q = input()
w = input()
s = input()
ans = ''
for i in range(len(s)):
	if s[i].isdigit():
		ans += s[i]
	else:
		m = q.find(s[i].lower())
		x = w[m]
		if s[i].isupper():
			ans += x.upper()
		else:
			ans += x
print(ans)


keyboard1 = input()
keyboard2 = input()
d = {}
for i in range(26):
	d[keyboard1[i]] = keyboard2[i]
result_string = ''
for c in input():
	if 97 <= ord(c) <= 122:
		result_string += d[c]
	elif 65 <= ord(c) <= 90:
		result_string += chr(ord(d[chr(ord(c) + 32)]) - 32)
	else:
		result_string += c
print(result_string)


def list_input():
	return list(map(int, input().split()))

def map_input():
	return map(int, input().split())

def map_string():
	return input().split()
a = input()
b = input()
c = input()
d = {}
for i in range(26):
	d[a[i]] = b[i]
	d[a[i].upper()] = b[i].upper()
for i in range(10):
	d[str(i)] = str(i)
for i in range(len(c)):
	print(d[c[i]], end='')


import sys
(old, new, input) = sys.stdin.read().splitlines()

def convert(x):
	x_lower = x.lower()
	if x_lower in old:
		y = new[old.index(x.lower())]
	else:
		y = x
	return y.upper() if x.isupper() else y
print(''.join(map(convert, input)))


s = input()
g = s.upper()
n = input()
h = n.upper()
a = list(input())
f = True
q = ''
for i in range(len(a)):
	l = ''
	l = a[i]
	if l.isupper():
		for z in range(len(s)):
			if l == g[z]:
				l = h[z]
				break
		f = False
	else:
		for z in range(len(s)):
			if l == s[z]:
				l = n[z]
				break
	q += l
print(q)


keys = []
values = []
wanted = []
answer = []
pairs = {}
firstInput = input()
firstInput = firstInput.split()
secondInput = input()
secondInput = secondInput.split()
thirdLine = input()
thirdLine = thirdLine.split()
for i in range(firstInput.__len__()):
	keys += firstInput[i]
for i in range(secondInput.__len__()):
	values += secondInput[i]
for i in range(thirdLine.__len__()):
	wanted += thirdLine[i]
for i in range(keys.__len__()):
	pairs[keys[i]] = values[i]
for i in range(wanted.__len__()):
	if not wanted[i].isalpha():
		answer += wanted[i]
	elif wanted[i].isupper():
		answer += pairs[wanted[i].lower()].upper()
	else:
		answer += pairs[wanted[i]]
print(''.join(answer))


a = list(input())
b = list(input())
c = input()
v = []
for i in c:
	if i.isalpha():
		if i.isupper():
			i = i.lower()
			q = a.index(i)
			v.append(b[q].upper())
		else:
			q = a.index(i)
			v.append(b[q])
	else:
		v.append(i)
print(''.join(v))


first = str(input())
second = str(input())
s = str(input())
output = []
for i in range(len(s)):
	c = s[i]
	if c.isdigit():
		output.append(c)
	else:
		temp = c.lower()
		out = second[first.index(temp)]
		if c.isupper():
			output.append(out.upper())
		else:
			output.append(out.lower())
print(''.join(output))


n = list(input())
m = list(input())
l = list(input())
ans = []
ans1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
for i in range(len(l)):
	for j in range(len(n)):
		if l[i].lower() == n[j]:
			if l[i] == l[i].lower():
				ans.append(m[j])
			elif l[i] != l[i].lower():
				ans.append(m[j].upper())
	if l[i] in ans1:
		ans.append(l[i])
for i in range(len(ans)):
	print(ans[i], end='')


first = list(input())
second = list(input())
n = input()
rem = ''
for i in n:
	if i.isalpha():
		if i.lower() == i:
			temp = first.index(i.lower())
			x = second[temp]
			rem += x
		elif i.lower() != i:
			temp = first.index(i.lower())
			x = second[temp]
			rem += x.upper()
	else:
		rem += i
print(rem)


m = {}
for (first, second) in zip(input(), input()):
	m[first] = second
	m[first.upper()] = second.upper()
res = []
for ch in str(input()):
	res += m.get(ch, ch)
print(''.join(res))


(Line1, Line2, Line3) = (input(), input(), input())
for i in range(len(Line3)):
	if Line3[i].isdecimal():
		if i < len(Line3) - 1:
			continue
	else:
		temp = Line3[i].lower()
		temp = Line2[Line1.find(temp)]
		if Line3[i].isupper():
			Line3 = Line3[:i] + temp.upper() + Line3[i + 1:]
		else:
			Line3 = Line3[:i] + temp + Line3[i + 1:]
print(''.join(Line3))


s1 = input()
s2 = input()
t = input()
vocab = dict(zip(s1 + s1.upper(), s2 + s2.upper()))
print(''.join(map(lambda x: vocab.get(x, x), t)))


a = input().strip()
au = a.upper()
b = input().strip()
bu = b.upper()
x = input().strip()
r = []
for v in x:
	if v in a:
		r.append(b[a.index(v)])
	elif v in au:
		r.append(bu[au.index(v)])
	else:
		r.append(v)
print(''.join(r))


a = input()
b = input()
s = input()
translation_table = s.maketrans(a + a.upper(), b + b.upper())
print(s.translate(translation_table))


trans = {}
for (l1, l2) in zip(input().strip(), input().strip()):
	trans[l1] = l2
	trans[l1.upper()] = l2.upper()
print(''.join([trans[x] if x in trans else x for x in input().strip()]))


T1 = input('')
T2 = input('')
T3 = input('')
T4 = T3.lower()
T = ''
for k in range(len(T4)):
	if T4[k].isdigit() == False:
		a = T1.index(T4[k])
		if T3[k].islower():
			T += T2[a]
		else:
			T += T2[a].upper()
	else:
		T += T4[k]
print(T)


layout1 = input()
layout2 = input()
layout1 += layout1.upper() + '0123456789'
layout2 += layout2.upper() + '0123456789'
original = input()
translated = ''
table = {}
for i in range(len(layout1)):
	table[layout1[i]] = layout2[i]
for char in original:
	translated += table[char]
print(translated)


a = input()
b = input()
c = list(input())
for i in range(len(c)):
	if c[i].swapcase() in a:
		swap = c[i].swapcase()
		c[i] = b[a.find(swap)].swapcase()
	elif c[i] in a:
		c[i] = b[a.find(c[i])]
	else:
		pass
print(''.join(c))


guar = input()
asg = input()
s = input()
for i in range(0, len(guar)):
	guar = guar + chr(ord(guar[i]) - 32)
	asg = asg + chr(ord(asg[i]) - 32)
guar = guar + '0123456789'
asg = asg + '0123456789'
ans = ''
for i in range(0, len(s)):
	c = s[i]
	index = guar.index(c)
	ans = ans + asg[index]
print(ans)


layout1 = input()
layout2 = input()
s = input()
d = {}
alph = set()
for i in range(26):
	d[layout1[i]] = layout2[i]
l = []
for i in range(len(s)):
	if s[i].islower():
		if s[i] in layout1:
			l.append(d[s[i]])
	elif s[i].lower() in layout1:
		l.append(d[s[i].lower()].upper())
	else:
		l.append(s[i])
out = ''
for i in range(len(l)):
	out += l[i]
print(out)


d = {}
s = input()
s1 = input()
for i in range(26):
	d[s[i]] = s1[i]
s2 = input()
ans = ''
for i in range(len(s2)):
	if s2[i].isdigit():
		ans += s2[i]
		continue
	flag = s2[i].isupper()
	tmp = s2[i].lower()
	tmp = d[tmp]
	if flag:
		ans += tmp.upper()
	else:
		ans += tmp
print(ans)


layout1 = input()
layout2 = input()
string = input()
output = ''
for i in range(0, len(string), 1):
	char = string[i]
	if char.isdigit() == True:
		output += char
		continue
	lo = char.lower()
	for i in range(0, 26, 1):
		if lo == layout1[i]:
			index = i
			break
	if char.islower() == True:
		output += layout2[index]
	else:
		output += layout2[index].upper()
print(output)


def main():
	keyboard1 = input()
	keyboard2 = input()
	text = input()
	result = ''
	for c in text:
		try:
			c_lower = c.lower()
			i = keyboard1.index(c_lower)
			result += keyboard2[i] if c_lower == c else keyboard2[i].upper()
		except ValueError:
			result += c
	print(result)
main()


s1 = input()
s2 = input()
s = input()
out = ''
for i in range(len(s)):
	if s[i].lower() in s1:
		h = s2[s1.find(s[i].lower())]
		if s[i] == s[i].upper():
			out += h.upper()
		else:
			out += h
	else:
		out += s[i]
print(out)


s = input()
t = input()
dic = {}
for i in range(26):
	dic[s[i]] = t[i]
q = input()
p = ''
for i in range(len(q)):
	if q[i].isdigit():
		p += q[i]
	elif q[i].upper() == q[i]:
		p += dic[q[i].lower()].upper()
	else:
		p += dic[q[i]]
print(p)


first = input()
second = input()
string = input()
first += first.upper()
second += second.upper()
transtable = string.maketrans(first, second)
print(string.translate(transtable))


s = input()
r = input()
a = dict()
for i in range(26):
	a.update({s[i]: r[i]})
s = s.upper()
r = r.upper()
for i in range(26):
	a.update({s[i]: r[i]})
s = input()
for i in s:
	if i in a:
		print(a[i], end='')
	else:
		print(i, end='')


first = str(input())
second = str(input())
line = input()
result = ''
for word in line:
	if word.isdigit():
		result += word
	else:
		i = first.find(word)
		if i == -1:
			i = first.upper().find(word)
			result += second[i].upper()
		else:
			result += second[i]
print(result)


layer1 = input()
layer2 = input()
mystr = input()
for letter in mystr:
	if letter.isalpha():
		newl = layer2[layer1.index(letter.lower())]
	else:
		newl = letter
	print(newl.upper() if letter.isupper() else newl, end='')


a = input()
b = input()
haslo = input()
slownik = dict()
index = 0
duza = False
for i in a:
	slownik[i] = b[index]
	index += 1
for i in haslo:
	if i.isupper():
		duza = True
	else:
		duza = False
	if slownik.get(i.lower()) == None:
		print(i, end='')
	elif duza:
		print(slownik[i.lower()].upper(), end='')
	else:
		print(slownik[i.lower()], end='')


intab = input()
outtab = input()
intab += intab.upper()
outtab += outtab.upper()
transtab = str.maketrans(intab, outtab)
in_string = input()
print(in_string.translate(transtab))


first_layout = input().strip()
second_layout = input().strip()
message = input().strip()
output_message = ''
for i in message:
	isUpper = 0
	if i == i.upper():
		isUpper = 1
	if i.lower() in first_layout:
		ind = first_layout.find(i.lower())
		if isUpper == 1:
			output_message = output_message + second_layout[ind].upper()
		else:
			output_message = output_message + second_layout[ind]
	elif isUpper == 1:
		output_message = output_message + i.upper()
	else:
		output_message = output_message + i
print(output_message)


firstLayout = input()
secondLayout = input()
speech = input()
speechLength = len(speech)
result = ''
for i in range(0, speechLength):
	if speech[i] >= '0' and speech[i] <= '9':
		result += speech[i]
		continue
	letterIndex = firstLayout.index(speech[i].lower())
	result += secondLayout[letterIndex].lower() if speech[i].islower() else secondLayout[letterIndex].upper()
print(result)


a = input()
b = input()
m = {a[i]: b[i] for i in range(len(a))}
s = input()
ans = ''
for i in s:
	if i.islower():
		ans += m[i]
	elif i.isupper():
		ans += m[i.lower()].upper()
	else:
		ans += i
print(ans)


s1 = input()
s2 = input()
s = input()
r = ''
for i in s:
	if i.isalpha():
		if i.isupper():
			r += s2[s1.index(i.lower())].upper()
		else:
			r += s2[s1.index(i.lower())]
	else:
		r += i
print(r)


first = input()
second = input()
s = input()
for i in range(len(s)):
	if 65 <= ord(s[i]) <= 90:
		print(second[first.index(s[i].lower())].upper(), end='')
	elif 48 <= ord(s[i]) <= 57:
		print(s[i], end='')
	else:
		print(second[first.index(s[i])], end='')


s1 = input()
s2 = input()
s3 = input()
k = ''
for i in range(len(s3)):
	if 65 <= ord(s3[i]) <= 90:
		k = k + s2[s1.find(s3[i].lower())].upper()
	elif 97 <= ord(s3[i]) <= 126:
		k = k + s2[s1.find(s3[i])]
	else:
		k = k + s3[i]
print(k)


AA = dict()
(t, s, r) = [[i for i in input()] for j in range(3)]
for i in range(26):
	AA[t[i]] = s[i]
for i in range(len(r)):
	if ord(r[i]) in range(ord('a'), ord('z') + 1):
		r[i] = AA[r[i]]
	elif ord(r[i]) in range(ord('A'), ord('Z') + 1):
		r[i] = chr(ord(AA[chr(ord(r[i]) - ord('A') + ord('a'))]) - ord('a') + ord('A'))
print(''.join(r))


fs = input()
ss = input()
s = list(input())
for i in range(len(s)):
	if 64 < ord(s[i]) < 91:
		c = s[i].lower()
		s[i] = ss[fs.index(c)].upper()
	elif 96 < ord(s[i]) < 123:
		s[i] = ss[fs.index(s[i])]
	else:
		continue
print(''.join(s))


s1 = input()
s2 = input()
s1 += s1.upper()
s2 += s2.upper()
d = {}
for i in range(52):
	d[s1[i]] = s2[i]
s = input()
ans = ''
for i in s:
	if not i.isdigit():
		ans += d[i]
	else:
		ans += i
print(ans)


(a, b, s) = [input() for i in '   ']
low = lambda c: chr(ord(c) + ord('a') - ord('A'))
hig = lambda c: chr(ord(c) - ord('a') + ord('A'))
ish = lambda c: ord('A') <= ord(c) <= ord('Z')
f = lambda c: b[a.index(c)]
ans = [''] * len(s)
for i in range(len(s)):
	c = s[i]
	if ord('0') <= ord(c) <= ord('9'):
		ans[i] = c
	elif ish(c):
		ans[i] = hig(f(low(c)))
	else:
		ans[i] = f(c)
print(''.join(ans))


(a, b, s) = (input(), input(), input())
d = dict(zip(a, b))
ans = ''
for c in s:
	if c.isalpha():
		ans += d[c] if c.islower() else d[c.lower()].upper()
	else:
		ans += c
print(ans)


a = input()
b = input()
c = input()
for k in c:
	if k.lower() in a:
		i = b[a.index(k.lower())]
		if k.isupper():
			print(i.upper(), end='')
		else:
			print(i, end='')
	else:
		print(k, end='')


(a, b) = (input(), input())
for i in input():
	if i.isdigit():
		print(i, end='')
	elif i.isupper():
		print(b[a.find(i.lower())].upper(), end='')
	else:
		print(b[a.find(i)], end='')


a = input()
b = input()
A = a.upper()
B = b.upper()
s = input()
s = s.translate(s.maketrans(a, b))
s = s.translate(s.maketrans(A, B))
print(s)


hashing = [0 for i in range(26)]
first = input()
second = input()
text = input()
for i in range(26):
	hashing[ord(first[i].lower()) - 97] = second[i]
for i in text:
	if i.isdigit():
		print(i, end='')
	elif i == i.upper():
		print(hashing[ord(i.lower()) - 97].upper(), end='')
	else:
		print(hashing[ord(i.lower()) - 97], end='')


s = input()
t = input()
d = {}
for i in range(26):
	d[s[i]] = t[i]
w = input()
result = ''
for i in range(len(w)):
	if w[i].isupper() and 65 <= ord(w[i]) <= 90:
		result += d[w[i].lower()].upper()
	elif 97 <= ord(w[i]) <= 122:
		result += d[w[i]]
	else:
		result += w[i]
print(result)


engAlfabetLover = str(input())
otherAlfabet = str(input())
word = input()
res = ''
engAlfabetUpper = engAlfabetLover.upper()
for item in word:
	cLoverCase = engAlfabetLover.index(item) if item in engAlfabetLover else -1
	cUpperCase = engAlfabetUpper.index(item) if item in engAlfabetUpper else -1
	if cLoverCase != -1:
		res += otherAlfabet[cLoverCase]
	elif cUpperCase != -1:
		res += otherAlfabet[cUpperCase].upper()
	else:
		res += item
print(res)


r1 = input()
for i in range(26):
	r1 += r1[i].upper()
r2 = input()
for i in range(26):
	r2 += r2[i].upper()
for i in input():
	l = r1.find(i)
	if l == -1:
		print(i, end='')
	else:
		print(r2[l], end='')


L1 = list(input())
L2 = list(input())
L3 = list(input())
for i in L3:
	FLAG = 0
	if i.isupper():
		i = i.lower()
		FLAG = 1
	if i.islower() == False and i.isupper() == False:
		print(i, end='')
	for j in range(len(L1)):
		if L1[j] == i:
			if FLAG == 1:
				print(L2[j].upper(), end='')
			else:
				print(L2[j], end='')
			break


s1 = input()
s2 = input()
s = input()
alph = dict()
for i in range(10):
	alph[str(i)] = str(i)
for i in range(len(s1)):
	alph[s1[i]] = s2[i]
for i in s:
	if i.isupper():
		print(alph[i.lower()].upper(), end='')
	else:
		print(alph[i], end='')


x = [i for i in input()]
y = [i for i in input()]
z = [i for i in input()]
m1 = dict(zip(x, y))
result = ''
for i in z:
	if i.isdigit():
		result += i
	elif i.isupper():
		result += m1[i.lower()].upper()
	else:
		result += m1[i]
print(result)


l1 = list(input())
l2 = list(input())
l1u = [i.upper() for i in l1]
l2u = [i.upper() for i in l2]
tx = list(input())
outtxt = []
for i in tx:
	if i in l1:
		outtxt.append(l2[l1.index(i)])
	elif i in l1u:
		outtxt.append(l2u[l1u.index(i)])
	else:
		outtxt.append(i)
print(*outtxt, sep='')


a = input()
b = input()
d = {}
for i in range(len(a)):
	d[a[i]] = b[i]
s = input()
q = []
for i in s:
	if ord(i) <= 57:
		q.append(i)
	elif ord(i) <= 90:
		q.append(chr(ord(d[chr(ord(i) + 32)]) - 32))
	else:
		q.append(d[i])
for i in q:
	print(i, end='')


s = input()
s1 = input()
s2 = input()
res = ''
for i in range(0, len(s2)):
	if s2[i].lower() in s:
		sx = s1[s.index(s2[i].lower())]
		if s2[i].isupper():
			res += sx.upper()
		else:
			res += sx.lower()
	else:
		res += s2[i]
print(res)


n = input()
m = input()
k = input()
vig = ''
for i in range(len(k)):
	if k[i].isupper():
		s = n.index(k[i].lower())
		vig = vig + m[s].upper()
	elif k[i].islower():
		k[i].lower()
		s = n.index(k[i].lower())
		vig = vig + m[s].lower()
	else:
		vig = vig + k[i]
print(vig)


l1 = list(input())
l2 = list(input())
s = list(input())
mp = {}
for i in range(26):
	mp[l1[i]] = l2[i]
	mp[l1[i].upper()] = l2[i].upper()
print(''.join(map(lambda c: mp[c] if c in mp else c, s)))


l1 = list(input())
l2 = list(input())
s = list(input())
ans = []
for i in s:
	if i.lower() in l1:
		if i.islower():
			t = l2[l1.index(i)]
		else:
			t = l2[l1.index(i.lower())].upper()
	else:
		t = i
	ans.append(t)
print(''.join(ans))


m = input()
l = input()
texte = input()
langue = []
modifie = []
dechif = ''
for i in range(len(l)):
	langue.append(str(l[i]))
	modifie.append(str(m[i]))
L = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for k in L:
	langue.append(k)
	modifie.append(k)
for j in texte:
	if j.isupper():
		dechif += str(langue[modifie.index(str(j.lower()))]).upper()
	else:
		dechif += str(langue[modifie.index(str(j))])
print(dechif)


a = input()
b = input()
c = input()
(amap, bmap) = ({}, {})
for (i, ch) in enumerate(a):
	amap[ch] = i
for (i, ch) in enumerate(b):
	bmap[i] = ch
O = []
for ch in c:
	if ch.isalpha():
		upper = ch.isupper()
		i = amap[ch.lower()]
		cx = bmap[i]
		if upper:
			O.append(cx.upper())
		else:
			O.append(cx)
	else:
		O.append(ch)
print(''.join(O))


FILE = 'test2'
try:
	inFile = open(FILE + '.txt')
except:
	pass

def read():
	try:
		return inFile.readline().strip()
	except:
		return input().strip()
line1 = read()
line2 = read()
line3 = read()
lst = []
for s in line3:
	c = s.lower()
	position = line1.find(c)
	if position == -1:
		lst.append(c)
	else:
		x = ''
		if s.isupper():
			x = line2[position].upper()
		else:
			x = line2[position].lower()
		lst.append(x)
print(''.join(lst))


s1 = input()
s2 = input()
s = input()
s1 = s1 + s1.upper()
s2 = s2 + s2.upper()
rez = ''
for x in s:
	if x in s1:
		rez = rez + s2[s1.find(x)]
	else:
		rez = rez + x
print(rez)


s1 = input().strip()
s2 = input().strip()
s = input().strip()
l = list()
r = ''
for i in range(26):
	l.append([s1[i], s2[i]])
for i in s:
	if i.isnumeric():
		r += i
	elif i.isupper():
		for x in l:
			if x[0] == i.lower():
				r += x[1].upper()
	else:
		for x in l:
			if x[0] == i:
				r += x[1]
print(r)


arr1 = list(input(''))
arr2 = list(input(''))
arr3 = list(input(''))
dic = {}
for i in range(len(arr1)):
	dic[arr1[i]] = arr2[i]
for k in range(len(arr3)):
	try:
		int(arr3[k])
		continue
	except:
		if arr3[k].isupper():
			arr3[k] = dic[arr3[k].lower()]
			arr3[k] = arr3[k].upper()
		else:
			arr3[k] = dic[arr3[k]]
print(''.join(arr3))


a = input()
b = input()
c = input()
e = {}
for i in range(26):
	e[a[i]] = b[i]
	e[str.upper(a[i])] = str.upper(b[i])
for d in c:
	if d in e:
		print(e[d], end='')
	else:
		print(d, end='')
print()


import sys
from functools import reduce
from collections import Counter
import time
import datetime
import math

def ip():
	return int(sys.stdin.readline())

def sip():
	return input()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def slip():
	return list(map(str, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
first = sip()
second = sip()
final = sip()
result = [0] * 26
ans = ''
for i in range(26):
	result[ord(first[i]) - 97] = second[i]
for item in final:
	if ord(item) >= 48 and ord(item) <= 57:
		ans += item
	elif ord(item) < 96:
		ans += chr(ord(result[ord(item) + 32 - 97]) - 32)
	else:
		ans += result[ord(item) - 97]
print(ans)


def f(lang_1, lang_2, string):
	result = []
	for x in string:
		if x.lower() in lang_1:
			r = lang_2[lang_1.find(x.lower())]
			if x.isupper():
				r = r.upper()
		else:
			r = x
		result.append(r)
	print(''.join(result))
lang_1 = input()
lang_2 = input()
string = input()
f(lang_1, lang_2, string)


a = list(input().strip())
b = list(input().strip())
x = list(input().strip())
m = []
for i in x:
	if i.isupper():
		i = i.lower()
		for (j, k) in zip(a, b):
			if j == i:
				m.append(k.upper())
	elif i.islower():
		for (j, k) in zip(a, b):
			if j == i:
				m.append(k)
	elif i.isdigit():
		m.append(i)
for i in m:
	print(i, end='')


s = input()
t = input()
for i in input():
	if i.lower() in s:
		print(chr(ord(t[s.index(i.lower())]) - ord(s[s.index(i.lower())]) + ord(i)), end='')
	else:
		print(i, end='')


(a, b, c) = (input(), input(), input())
ch = ''
for x in range(len(c)):
	k = a.find(c[x].lower())
	if k == -1:
		ch += c[x]
	elif c[x].islower():
		ch += b[k]
	else:
		ch += b[k].upper()
print(ch)


(a, b, s) = (input(), input(), input())
d = dict(zip(a, b))
new = ''
for i in s:
	if i.islower():
		if i in d.keys():
			new += d.get(i)
	elif i.isupper():
		i = i.lower()
		if i in d.keys():
			new += d.get(i).upper()
	else:
		new += i
print(new)


def main():
	first_string = input()
	second_string = input()
	text = input()
	lenght = len(text)
	result = ''
	char = ''
	pos = 0
	while pos < lenght:
		if text[pos].lower() in first_string:
			char = first_string.find(text[pos].lower())
			if 'A' <= text[pos] <= 'Z':
				result += second_string[char].upper()
			elif 'a' <= text[pos] <= 'z':
				result += second_string[char]
		if '0' <= text[pos] <= '9':
			result += text[pos]
		pos += 1
	return result
print(main())


a = input()
b = input()
c = input()
for i in range(len(c)):
	if c[i].isdigit():
		print(c[i], end='')
	else:
		for j in range(len(a)):
			if c[i].lower() == a[j]:
				if c[i].islower():
					print(b[j], end='')
				else:
					print(b[j].upper(), end='')


import string
s1 = str(input())
s2 = str(input())
s3 = str(input())
s1 = s1 + s1.upper()
s2 = s2 + s2.upper()
l = len(s3)
for i in reversed(range(l)):
	for q in range(len(s1)):
		if s1[q] == s3[i]:
			s3 = s3[:i] + s2[q] + s3[i + 1:]
			break
print(s3)


import math
import sys
import re
l1 = input()
l2 = input()
s = input()
s1 = ''
for x in s:
	if x.isdigit():
		s1 = s1 + x
	else:
		n = l1.index(x.lower())
		if x.isupper():
			s1 = s1 + l2[n].upper()
		else:
			s1 = s1 + l2[n]
print(s1)


a = input()
b = input()
s = input()
z = s.lower()
for i in range(len(s)):
	if not z[i].isdigit():
		v = a.index(z[i])
		if s[i].isupper():
			print(b[v].upper(), end='')
		else:
			print(b[v], end='')
	else:
		print(z[i], end='')


a = input()
b = input()
x = input()
print(''.join([b[a.index(i.lower())].upper() if i.isupper() else i if i.isdecimal() else b[a.index(i.lower())] for i in x]))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	s = S()
	t = S()
	u = S()
	d = {}
	for i in range(26):
		si = ord(s[i]) - ord('a')
		ti = ord(t[i]) - ord('a')
		d[chr(ord('a') + si)] = chr(ord('a') + ti)
		d[chr(ord('A') + si)] = chr(ord('A') + ti)
	r = []
	for c in u:
		if c in d:
			r.append(d[c])
		else:
			r.append(c)
	return ''.join(r)
print(main())


def Keyboard(L1, L2, K):
	Dict = dict()
	for i in range(len(L1)):
		Dict[L1[i]] = L2[i]
	Out = ''
	for i in K:
		if i.islower():
			Out += Dict[i]
		elif i.lower() in Dict:
			Out += Dict[i.lower()].upper()
		else:
			Out += i
	return Out
laytout1 = input()
laytout2 = input()
Typing = input()
print(Keyboard(laytout1, laytout2, Typing))


from sys import stdin
string_1 = stdin.readline()
string_2 = stdin.readline()
string_3 = stdin.readline()
map = {}
for index in range(0, len(string_1)):
	map[string_1[index]] = string_2[index]
result = ''
for index in range(0, len(string_3)):
	char = string_3[index]
	if char in map or char.lower() in map:
		if char.isupper():
			result += map[char.lower()].upper()
		else:
			result += map[char]
	else:
		result += char
print(result)


lay1 = input()
lay2 = input()
string = input()
s = ''
for i in string:
	if i.isdigit():
		s += i
	elif i.isupper():
		j = lay1.find(i.lower())
		s += lay2[j].upper()
	else:
		j = lay1.find(i.lower())
		s += lay2[j]
print(s)


layout1 = input()
layout2 = input()
s = input()
output = ''
for i in range(0, len(s)):
	if s[i].isdigit():
		output += s[i]
		continue
	letter = layout2[layout1.find(s[i].lower())]
	if s[i].isupper():
		output += letter.upper()
	else:
		output += letter
print(output)


a = input()
b = input()
c = input()
d = {a[i]: b[i] for i in range(26)}
e = ''
for i in c:
	if ord(i) >= 65 and ord(i) <= 90:
		i = i.swapcase()
		k = d[i]
		k = k.swapcase()
		e += k
	elif ord(i) >= 97 and ord(i) <= 122:
		k = d[i]
		e += k
	else:
		e += i
print(e)


a = input()
b = input()
d = dict(zip(a + a.upper(), b + b.upper()))
print(''.join((d.get(c, c) for c in input())))


a1 = input()
a2 = input()
a3 = input()
d = dict(zip(a1, a2))
re = ''
for a in a3:
	if a.isalpha():
		if a.isupper():
			re += d[a.lower()].upper()
		else:
			re += d[a]
	else:
		re += a
print(re)


(s1, s2) = (input(), input())
modify = {ch1: ch2 for (ch1, ch2) in zip(s1 + s1.upper(), s2 + s2.upper())}
print(''.join((modify[ch] if ch in modify else ch for ch in input())))


a1 = input()
a2 = input()
test = input()
for i in test:
	if i.isdigit():
		print(i, end='')
	else:
		temp = i.casefold()
		if temp == i:
			print(a2[a1.index(i)], end='')
		else:
			print(a2[a1.index(temp)].capitalize(), end='')


type1 = input()
type2 = input()
s = input()
d = {}
for i in range(26):
	d[type1[i]] = type2[i]
answer = ''
for i in s:
	if i.isdigit():
		answer += i
	elif i.isupper():
		answer += d[i.lower()].upper()
	else:
		answer += d[i]
print(answer)


from sys import stdout
fir = input()
sec = input()
s = input()
mapa = {}
for i in range(26):
	mapa[fir[i]] = i
for i in s:
	if not i.isalpha():
		stdout.write(i)
		continue
	if i.isupper():
		stdout.write(sec[mapa[i.lower()]].upper())
	else:
		stdout.write(sec[mapa[i]])
stdout.write('\n')
stdout.flush()


one = input()
two = input()
start = input()
answer = ''
for ch in start:
	low = ch.lower()
	index = one.find(low)
	if index == -1:
		answer += ch
	elif low == ch:
		answer += two[index]
	else:
		answer += two[index].upper()
print(answer)


S = input()
S1 = input()
S2 = input()
T = ''
for i in range(len(S2)):
	if S2[i] not in S:
		if S2[i].lower() in S:
			T = T + S1[S.index(S2[i].lower())].upper()
		else:
			T = T + S2[i]
	else:
		T = T + S1[S.index(S2[i])]
print(T)


s1 = input()
s1u = s1.upper()
s2 = input()
s2u = s2.upper()
s = input()
r = ''
for i in s:
	if i in s1:
		r += s2[s1.index(i)]
	elif i in s1u:
		r += s2u[s1u.index(i)]
	else:
		r += i
print(r)


keyboard1 = input()
keyboard2 = input()
text = input()
keyboard = dict(zip(keyboard1, keyboard2))
result = ''
for i in text:
	if i.isupper():
		i = i.lower()
		if i in keyboard.keys():
			result += keyboard[i].upper()
	elif i.islower():
		if i in keyboard.keys():
			result += keyboard[i]
	else:
		result += str(i)
print(result)


ch = input()
ch2 = input()
in1 = input()
out = ''
for i in range(0, len(in1)):
	if in1[i].isdigit():
		out += in1[i]
	elif in1[i].islower():
		k = ch.index(in1[i])
		out += ch2[k]
	else:
		temp = in1[i].lower()
		k = ch.index(in1[i].lower())
		out += ch2[k].upper()
print(out)


a1 = input()
a2 = input()
s = input()
d = ''
for i in range(0, len(s)):
	if s[i].isalpha() == True:
		if s[i].isupper() == True:
			for j in range(0, len(a1)):
				if a1[j] == s[i].lower():
					d = d + a2[j].upper()
		else:
			for j in range(0, len(a1)):
				if a1[j] == s[i]:
					d = d + a2[j]
	else:
		d = d + s[i]
print(d)


s1 = input()
s2 = input()
t = input()
for i in t:
	if 65 <= ord(i) <= 91:
		print(s2[s1.index(i.lower())].upper(), end='')
	elif 48 <= ord(i) <= 57:
		print(i, end='')
	else:
		print(s2[s1.index(i)], end='')


A = list(input())
B = list(input())
c = list(input())
for i in range(len(c)):
	if ord(c[i]) in range(48, 58):
		print(c[i], end='')
	elif ord(c[i]) < 97:
		print(B[A.index(c[i].lower())].upper(), end='')
	else:
		print(B[A.index(c[i])], end='')


a = input()
b = input()
t = input()
ans = ''
for c in t:
	flag = 0
	if 65 <= ord(c) <= 90:
		flag = 1
		c = c.lower()
		ans += b[a.find(c)].upper()
	elif 97 <= ord(c) <= 122:
		ans += b[a.find(c)]
	else:
		ans += c
print(ans)


a = input()
b = input()
c = [i for i in range(0, 27)]
d = [i for i in range(0, 27)]
e = input()
k = 0

def get_char(o):
	for x in range(0, 27):
		if o == a[x]:
			return b[x]
m = e
n = list(m)
s = 'o'
for y in e:
	if '1' <= y <= '9':
		n[k] = y
	elif y.islower():
		n[k] = get_char(y)
	elif y.isupper():
		s = y.lower()
		s = get_char(s)
		n[k] = s.upper()
	k += 1
m = ''.join(n)
print(m)


l = str(input())
k = str(input())
s = str(input())
lp = ''.join([chr(ord(i) - 32) for i in l])
kp = ''.join([chr(ord(i) - 32) for i in k])
res = ''
for i in s:
	if i in l:
		res += k[l.index(i)]
	elif i in lp:
		res += kp[lp.index(i)]
	else:
		res += i
print(res)


a = input().upper()
b = input().upper()
c = input()
d = c
ans = ''
for (i, h) in zip(list(c.upper()), list(d)):
	if i in a:
		ans += chr(ord(h) - (ord(a[a.index(i)]) - ord(b[a.index(i)])))
	else:
		ans += h
print(ans)


a = input()
b = input()
s = ''
for i in input():
	if ord('a') <= ord(i):
		s += b[a.index(i)]
	elif ord(i) <= 57:
		s += i
	else:
		s += b[a.index(i.lower())].upper()
print(s)


a = dict(zip(input(), input()))
for i in input():
	if i.islower():
		print(a[i], end='')
	elif i.isupper():
		print(a[i.lower()].upper(), end='')
	else:
		print(i, end='')


a = input()
b = input()
b = list(b)
c = input()
d = []
c = list(c)
l = len(c)
for i in range(0, l):
	if c[i] >= '0' and c[i] <= '9':
		d.append(c[i])
	else:
		s = c[i]
		if s.isupper():
			s = c[i]
			c[i] = c[i].lower()
		m = a.index(c[i])
		if s.isupper():
			b[m] = b[m].upper()
			d.append(b[m])
		else:
			b[m] = b[m].lower()
			d.append(b[m])
e = ''.join(d)
print(e)


str1 = input()
str2 = input()
str3 = input()
key_map = {}
for i in range(len(str1)):
	key_map.update({str1[i].lower(): str2[i].lower()})
	key_map.update({str1[i].upper(): str2[i].upper()})
out = []
for char in str3:
	out += key_map.get(char, char)
print(''.join(out))


__metaclass__ = type
import math
import sys
import heapq

def input_array(convert_type):
	return [convert_type(x) for x in input().split()]

def CF831A():
	a = input()
	b = input()
	s = input()
	a = a.lower()
	b = b.lower()
	ra = {}
	for x in range(26):
		ra[a[x]] = x
	ans = []
	upper = False
	for x in s:
		if not x.isalpha():
			ans.append(x)
			continue
		upper = x.isupper()
		x = x.lower()
		t = b[ra[x]]
		if upper:
			t = t.upper()
		ans.append(t)
		upper = False
	print(''.join(ans))
CF831A()


d = {}
n = input()
s = input()
v = input()
l = []
for i in range(len(n)):
	d[n[i]] = s[i]
for i in v.lower():
	if i.isalpha():
		l.append(d[i])
	else:
		l.append(i)
for i in range(len(l)):
	if v[i].isupper():
		l[i] = chr(ord(l[i]) - 32)
print(*l, sep='')


layout1 = input()
layout2 = input()
text = input()
empty = ''
for x in text:
	if x.lower() not in layout1:
		empty += x
	else:
		y = layout1.index(x.lower())
		if x.islower():
			empty += layout2[y]
		else:
			empty += layout2[y].upper()
print(empty)


a = input()
b = input()
s = list(input())
for i in range(len(s)):
	e = s[i]
	if 'A' <= e <= 'Z':
		bad = True
		e = chr(ord(e) - ord('A') + ord('a'))
	elif 'a' <= e <= 'z':
		bad = False
	else:
		continue
	e = b[a.index(e)]
	if bad:
		e = chr(ord(e) - ord('a') + ord('A'))
	s[i] = e
print(''.join(s))


ch1 = input()
ch2 = input()
ch3 = input()
s = ''
for i in ch3:
	if i.isdigit():
		s += i
	else:
		j = i
		x = ch2[ch1.index(j.lower())]
		if i <= 'z' and i >= 'a':
			s += x
		else:
			s += x.upper()
print(s)


s1 = input()
s2 = input()
t = input()
ans = ''
for i in range(len(t)):
	flag = 0
	try:
		if t[i].isupper():
			flag = 1
		temp = t[i].lower()
		ind = s1.index(temp)
		if flag == 1:
			ans = ans + s2[ind].upper()
		else:
			ans = ans + s2[ind]
	except:
		ans = ans + t[i]
print(ans)


import math
myString1 = input()
myString2 = input()
myText = input()
myText = list(myText)
newText = ''
myMap = dict()
for i in range(len(myString1)):
	myMap[myString1[i]] = i
for i in range(len(myText)):
	if myText[i] == '0' or myText[i] == '1' or myText[i] == '2' or (myText[i] == '3') or (myText[i] == '4') or (myText[i] == '5') or (myText[i] == '6') or (myText[i] == '7') or (myText[i] == '8') or (myText[i] == '9'):
		newText += myText[i]
	elif myText[i].isupper() == True:
		myText[i] = myText[i].lower()
		newText += myString2[myMap[myText[i]]].upper()
	else:
		newText += myString2[myMap[myText[i]]]
print(newText)


r = input()
l = input()
s = input()
res = ''
for i in s:
	if i.isdigit():
		res += i
	elif i.isupper():
		res += l[r.index(i.lower())].upper()
	else:
		res += l[r.index(i)]
print(res)


def match(a, b, c):
	out = ''
	for i in c:
		if ord(i) < 60:
			out += i
		else:
			ind = a.index(i.lower())
			if ord(i) <= 92 and ord(i) >= 65:
				out += b[ind].upper()
			else:
				out += b[ind]
	return out
s1 = input()
s2 = input()
m = input()
print(match(s1, s2, m))


s = input()
a = input()
b = input()
di = {}
for i in range(len(s)):
	di[s[i]] = a[i]
for i in range(len(b)):
	if ord(b[i]) <= 90 and ord(b[i]) >= 65 or (ord(b[i]) <= 122 and ord(b[i]) >= 97):
		t = di[b[i].lower()]
		if ord(b[i]) <= 90:
			print(chr(ord(t) - 32), end='')
		else:
			print(t, end='')
	else:
		print(b[i], end='')


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
s1 = str(input())
s2 = input()
s3 = str(input())
ans = []
for a in s3:
	if a.isnumeric():
		ans.append(a)
	elif a.islower():
		i = s1.index(a)
		ans.append(s2[i])
	else:
		i = s1.index(a.lower())
		ans.append(str(s2[i]).upper())
print(''.join(ans))


board1 = input()
board2 = input()
board1cap = board1.upper()
board2cap = board2.upper()
string = input()
output = ''
for i in range(len(string)):
	if string[i] in board1:
		output += board2[board1.find(string[i])]
	elif string[i] in board1cap:
		output += board2cap[board1cap.find(string[i])]
	else:
		output += string[i]
print(output)


a = input()
b = input()
c = list(input())
for i in range(len(c)):
	for j in range(len(a)):
		if c[i] == a[j]:
			c[i] = b[j]
			break
		if c[i] == a[j].upper():
			c[i] = b[j].upper()
			break
print(''.join(c))


di = dict()
s = input()
t = input()
s1 = s.upper()
t1 = t.upper()
for i in range(len(s)):
	di[s[i]] = t[i]
	di[s1[i]] = t1[i]
g = input()
for i in range(len(g)):
	if g[i] in s or g[i] in s1:
		g = g[:i] + di[g[i]] + g[i + 1:]
print(g)


I = input
(a, b, c) = (I(), I(), I())
d = c.lower()
d = d.translate(d.maketrans(a, b))
print(''.join((d[i].upper() if c[i].isupper() else d[i] for i in range(len(c)))))


layout1 = input()
layout2 = input()
correct = {a: b for (a, b) in zip(layout1, layout2)}
line = input()
for c in line:
	if not c.isnumeric():
		print(correct[c.lower()].upper() if c.isupper() else correct[c.lower()], end='')
	else:
		print(c, end='')


a = input()
b = input()
c = input()
for i in c:
	if i.isdigit():
		print(i, end='')
	elif i.isupper():
		print(b[a.index(i.lower())].upper(), end='')
	else:
		print(b[a.index(i)], end='')
print()


s1 = input()
s2 = input()
s3 = input()
ans = ''
arr_1 = []
arr_2 = []
s3_arr = []
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
for i in s1:
	arr_1.append(i)
for i in s2:
	arr_2.append(i)
for i in s3:
	s3_arr.append(i)
for (index, i) in enumerate(s3_arr):
	if i in nums:
		ans += i
	for (x, y) in zip(arr_1, arr_2):
		x_ans = x
		if i.lower() == x.lower():
			if s3_arr[index] == x.upper():
				ans += y.upper()
			else:
				ans += y
print(ans)


ch1 = input()
ch2 = input()
ch3 = input()
d = {}
for i in range(len(ch1)):
	d[ch1[i].upper()] = ch2[i].upper()
	d[ch1[i].lower()] = ch2[i].lower()
s = ''
for i in ch3:
	if i.isdigit():
		s += i
	else:
		s += d[i]
print(s)


x = str(input(''))
y = str(input(''))
z = str(input(''))
s = ''
p = {}
for j in range(len(x)):
	p[x[j]] = y[j]
for i in z:
	if i.isalpha():
		j = i.lower()
		l = p[j]
		if i.isupper():
			s = s + l.upper()
		else:
			s = s + l
	else:
		s = s + i
print(s)


a = input()
b = input()
s = input()
d = dict((i for i in zip(a, b)))
ans = ''
for c in s:
	u = False
	tmp = None
	if c.isupper():
		tmp = True
		c = c.lower()
	if c in d.keys():
		r = d[c]
		if tmp:
			r = r.upper()
		ans += r
	else:
		ans += c
print(ans)


a = list(input())
b = list(input())
c = list(input())
for x in range(len(c)):
	if c[x].isupper():
		for j in range(len(a)):
			c[x].lower()
			if c[x].lower() == a[j]:
				m = b[j].upper()
				print(m, end='')
	elif c[x].islower():
		for j in range(len(a)):
			if c[x] == a[j]:
				print(b[j], end='')
	else:
		print(c[x], end='')


def solve():
	en1 = get(str)
	en2 = get(str)
	s = get(str)
	s2 = s.lower()
	d = dict(zip(en1, en2))
	ans = ''
	for (c, c1) in zip(s, s2):
		ans += chr(ord(c) - ord(c1) + ord(d[c1])) if 97 <= ord(c1) <= 122 else c
	return ans
_testcases = '\nqwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017\n\nHelloVKCup2017\n\nmnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7\n\n7uduGUDUUDUgudu7\n'.strip()
import re
import sys
import math
import heapq
from heapq import heapify, heappop, heappush
import bisect
from bisect import bisect_left, bisect_right
import operator
from operator import itemgetter, attrgetter
import itertools
import collections
inf = float('inf')
sys.setrecursionlimit(10000)

def tree():
	return collections.defaultdict(tree)

def cache(func):
	cache_dict = {}

	def _cached_func(*args, _get_cache=False):
		if _get_cache:
			return cache_dict
		if args in cache_dict:
			return cache_dict[args]
		cache_dict[args] = func(*args)
		return cache_dict[args]
	return _cached_func

def equal(x, y, epsilon=1e-06):
	if -epsilon <= x - y <= epsilon:
		return True
	if -epsilon <= x <= epsilon or -epsilon <= y <= epsilon:
		return False
	return -epsilon <= (x - y) / x <= epsilon or -epsilon <= (x - y) / y <= epsilon

def get(_type):
	if type(_type) == list:
		if len(_type) == 1:
			_type = _type[0]
			return list(map(_type, input().strip().split()))
		else:
			return [_type[i](inp) for (i, inp) in enumerate(input().strip().split())]
	else:
		return _type(input().strip())
print(solve())


s1 = input()
s2 = input()
text = input()
s11 = s1.upper()
s22 = s2.upper()
result = ''
for i in text:
	if not i.isdigit():
		index = s1.find(i)
		if index >= 0:
			result += s2[index]
		else:
			result += s22[s11.find(i)]
	else:
		result += i
print(result)


sh1 = input()
sh2 = input()
s = input()
cor = ''
for i in s:
	if i not in '0123456789':
		if i.isupper():
			cor += sh2[sh1.index(i.lower())].upper()
		else:
			cor += sh2[sh1.index(i)]
	else:
		cor += i
print(cor)


import string
t = list(input())
k = list(input())
z = list(input())
d = {}
mo = []
y = len(z)
for i in range(26):
	d[t[i]] = k[i]
for m in range(y):
	if str.isdigit(z[m]):
		mo.append(z[m])
	elif str.islower(z[m]):
		mo.append(d[z[m]])
	elif str.isupper(z[m]):
		zer = str.lower(z[m])
		kt = str.upper(d[zer])
		mo.append(kt)
ert = ''.join(mo)
print(ert)


str1 = input()
str2 = input()
str3 = input()
li = []
for i in str3:
	if i.isalpha():
		if i.isupper():
			str5 = i.lower()
			z12 = str1.find(str5)
			li.append(str2[z12].upper())
		else:
			z12 = str1.find(i)
			li.append(str2[z12])
	else:
		li.append(i)
str4 = ''
print(str4.join(li))


from string import ascii_letters
s1 = input()
s2 = input()
a = input()
d = dict([*zip(s1, s2), *zip(s1.upper(), s2.upper())])
print(*[d[i] if i in ascii_letters else i for i in a], sep='')


a = list(input())
b = list(input())
d = []
for i in range(26):
	a.append(chr(ord(a[i]) - 32))
	b.append(chr(ord(b[i]) - 32))
c = list(input())
for i in c:
	try:
		d.append(b[a.index(i)])
	except:
		d.append(i)
print(''.join(d))


l1 = input()
l2 = input()
s = input()
l12l2 = {}
for (c1, c2) in zip(l1, l2):
	l12l2[c1.lower()] = c2.lower()
	l12l2[c1.upper()] = c2.upper()
for i in range(10):
	l12l2[str(i)] = str(i)
res = ''
for c in s:
	res += l12l2[c]
print(res)


s1 = input()
s2 = input()
q = input()
d = {}
for i in range(26):
	d[s1[i]] = s2[i]
x = ''
for l in q:
	if l.isupper():
		lower = l.lower()
		x += d[lower].upper()
	elif l.isdigit():
		x += l
	else:
		x += d[l]
print(str(x))


a = str(input())
b = str(input())
c = str(input())
d = str()
for i in c:
	if i.isupper():
		d += b[a.index(i.lower())].upper()
	elif i.islower():
		d += b[a.index(i)]
	elif i.isdigit():
		d += i
print(d)


a = [i for i in input()]
for i in range(26):
	a += [chr(ord(a[i]) + ord('A') - ord('a'))]
b = [i for i in input()]
for i in range(26):
	b += [chr(ord(b[i]) + ord('A') - ord('a'))]
d = {a[i]: b[i] for i in range(52)}
s = input()
for i in s:
	if i in d:
		print(d[i], end='')
	else:
		print(i, end='')


l0 = list(input())
l1 = list(input())
s = list(input())
for i in range(len(s)):
	if s[i] == s[i].lower() and s[i] == s[i].upper():
		continue
	elif s[i] == s[i].lower():
		s[i] = l1[l0.index(s[i])]
	elif s[i] == s[i].upper():
		s[i] = l1[l0.index(s[i].lower())].upper()
print(''.join(s))


from collections import defaultdict
(a, b, s, d, r) = (input(), input(), input(), defaultdict(str), '')
for (x, y) in zip(a, b):
	d[x] = y
	d[x.title()] = y.title()
for e in s:
	if e not in d.keys():
		r += e
	else:
		r += d[e]
print(r)


s1 = input()
s2 = input()
a = input()
ans = ''
for i in range(len(a)):
	if not a[i].isdigit():
		if a[i].islower():
			ind = s1.index(a[i])
			ans += s2[ind]
		else:
			ind = s1.index(a[i].lower())
			ans += s2[ind].upper()
	else:
		ans += a[i]
print(ans)


(A, B, s) = (input(), input(), input())
print(s.translate(str.maketrans(A + A.upper(), B + B.upper())))


a = list(input())
b = list(input())
c = list(input())
d = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
ans = ''
for i in range(len(c)):
	f = c[i].upper()
	if c[i] in d:
		ans += c[i]
	elif f == c[i]:
		c[i] = c[i].lower()
		ans += b[a.index(c[i])].upper()
	else:
		ans += b[a.index(c[i])]
print(ans)


fst = input()
snd = input()
thrd = input()
for i in range(len(thrd)):
	if ord(thrd[i]) < 65:
		print(thrd[i], end='')
	elif ord(thrd[i]) < 97:
		print(snd[fst.index(thrd[i].lower())].upper(), end='')
	else:
		print(snd[fst.index(thrd[i].lower())], end='')


s1 = input()
s1 = s1 + '1234567890'
s2 = input()
s2 = s2 + '1234567890'
s = input()
w = ''
for i in s:
	for j in range(len(s1)):
		if i.lower() == s1[j]:
			if i.isupper():
				w = w + s2[j].upper()
			else:
				w = w + s2[j]
print(w)


s = input()
s1 = input()
s2 = input()
l = []
for i in range(len(s2)):
	x = s.find(s2[i].lower())
	if s2[i].isupper():
		l.append(s1[x].upper())
	elif s2[i].islower():
		l.append(s1[x])
	elif s2[i].isdigit():
		l.append(s2[i])
print(''.join(l))


import collections
import string
key1 = input()
key2 = input()
s = input()
utable = dict(zip(key1.upper(), key2.upper()))
ltable = dict(zip(key1, key2))
dtable = dict(((c, c) for c in string.digits))
table = collections.ChainMap(utable, ltable, dtable)
print(*(table[c] for c in s), sep='')


a1 = input()
a2 = input()
s = input()
for x in s:
	if x in '0123456789':
		print(x, end='')
	else:
		t = a2[a1.index(x.lower())]
		print(t if x == x.lower() else t.upper(), end='')


string1 = input()
string2 = input()
string3 = input()
ans = []
for each in string3:
	if each.isdigit():
		ans.append(each)
	else:
		cnt = 0
		isCap = 0
		if each < 'a':
			each = chr(ord(each) + 32)
			isCap = 1
		for eachInString1 in string1:
			if eachInString1 == each:
				break
			else:
				cnt += 1
		if isCap:
			ans.append(chr(ord(string2[cnt]) - 32))
		else:
			ans.append(string2[cnt])
for each in ans:
	print(each, end='')


d1 = {}
d2 = {}
num = '0123456789'
s1 = str(input())
s2 = str(input())
s = str(input())
i = 0
for j in s2:
	d1[i] = j
	i += 1
i = 0
for k in s1:
	d2[k] = i
	i += 1
for k in s:
	if k not in num and k.islower():
		print(d1[d2[k]], end='')
	elif k not in num:
		k = k.lower()
		print(d1[d2[k]].upper(), end='')
	else:
		print(k, end='')


X = input()
X1 = input()
D = dict()
for i in range(len(X)):
	D[X[i]] = X1[i]
I = input()
for i in range(len(I)):
	if I[i].isnumeric():
		print(I[i], end='')
		continue
	if I[i].isupper():
		print(str(D[I[i].lower()]).upper(), end='')
		continue
	print(D[I[i]], end='')


rk1 = input()
rk2 = input()
s = input()
sums = ''
for i in range(len(s)):
	if s[i].isdigit():
		sums += s[i]
		continue
	for j in range(len(rk1)):
		if s[i].lower() == rk1[j]:
			if s[i] == s[i].upper():
				sums += rk2[j].upper()
			elif s[i] == s[i].lower():
				sums += rk2[j].lower()
print(sums)


first = input()
second = input()
text = input()
output = ''
for char in text:
	if char.isdigit():
		output += char
	else:
		index = first.index(char.lower())
		if char.isupper():
			output += second[index].upper()
		else:
			output += second[index]
print(output)


s = input()
S = input()
d = {}
for i in range(26):
	d[s[i]] = S[i]
a = input()
p = ''
for i in range(len(a)):
	if ord(a[i]) >= 65 and ord(a[i]) < 91:
		p = p + str(d[a[i].lower()]).upper()
	elif ord(a[i]) >= 97 and ord(a[i]) < 123:
		p = p + str(d[a[i]])
	else:
		p = p + a[i]
print(p)


first = input()
second = input()
string = input()
k = 0
sample = dict()
for i in first:
	sample[i] = k
	k += 1
for i in string:
	if i.isnumeric():
		print(i, end='')
	else:
		temp = i.isupper()
		index = sample[i.lower()]
		if temp:
			print(second[index].upper(), end='')
		else:
			print(second[index], end='')


first = input()
second = input()
message = input()
decode = ''
dict = {}
for i in range(len(first)):
	dict[first[i]] = second[i]
for n in range(0, 10):
	dict[str(n)] = str(n)
for j in range(len(message)):
	if message[j].isupper():
		decode = decode + dict[message[j].lower()].upper()
	else:
		decode = decode + dict[message[j]]
print(decode)


a = input()
b = input()
c = input()
t = ''
for i in range(len(c)):
	z = c[i]
	if ord(z) >= ord('A') and ord(z) <= ord('Z'):
		p = 'up'
	else:
		p = 'low'
	z = z.lower()
	try:
		h = a.index(z)
		if p == 'low':
			t += b[h].lower()
		else:
			t += b[h].upper()
	except:
		t += z
print(t)


import string
string1 = input() + '0123456789'
string2 = input() + '0123456789'
string = input()
char_dict = dict(zip(string1, string2))
string3 = string
char_str3 = [char for char in string3]
answer = ''
for char in char_str3:
	if char.isupper():
		lowering = char.lower()
		value = str(char_dict.get(lowering))
		answer += value.capitalize()
	else:
		answer += char_dict.get(char)
print(answer)


from collections import *
import sys

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
azerty = input()
qwerty = input()
word = input()
d = dict()
for i in range(26):
	d[azerty[i]] = qwerty[i]
	d[azerty[i].upper()] = qwerty[i].upper()
ans = [''] * len(word)
for i in range(len(word)):
	if word[i] in d:
		ans[i] = d[word[i]]
	else:
		ans[i] = word[i]
print(''.join(ans))


def per(s):
	global t1, t2
	for i in range(len(t1)):
		if s == t1[i]:
			return t2[i]
		elif ord(s) == ord(t1[i]) - 32:
			return chr(ord(t2[i]) - 32)
	return s
t1 = input()
t2 = input()
t = input()
n = len(t1)
o = ''
for s in t:
	s2 = per(s)
	o += s2
print(o)


def func(c):
	if c >= 'a' and c <= 'z':
		return True
	else:
		return False
k1 = input()
k2 = input()
s = input()
d = {}
for i in range(26):
	d[k1[i]] = i
for i in range(len(s)):
	if func(s[i]):
		print(k2[d[s[i]]], end='')
	elif s[i] >= '0' and s[i] <= '9':
		print(s[i], end='')
	else:
		print(k2[d[s[i].lower()]].upper(), end='')


d = {}
org_kb = input()
new_kb = input()
m = input()
for i in range(26):
	d[org_kb[i]] = new_kb[i]
for ch in m:
	if ch.lower() in d:
		new_ch = d[ch.lower()]
		print(new_ch if ch.islower() else new_ch.upper(), end='')
	else:
		print(ch, end='')


s = input()
r = input()
t = input()
k = ''
for i in range(len(t)):
	if 65 <= ord(t[i]) <= 91:
		p = s.index(chr(ord(t[i]) + 32))
		if 97 <= ord(r[p]) <= 122:
			k += chr(ord(r[p]) - 32)
		else:
			k += r[p]
	else:
		try:
			p = s.index(t[i])
			k += r[p]
		except:
			k += t[i]
print(k)


st1 = input()
st2 = input()
typed = input()
dict = {}
for i in range(26):
	dict.update({st1[i]: st2[i]})
st = ''
for i in range(len(typed)):
	ch = typed[i]
	if ch.isdigit():
		st = st + ch
	elif ch.isupper():
		st = st + dict[ch.lower()].upper()
	else:
		st = st + dict[ch]
print(st)


a = input()
b = input()
c = input()
a1 = a.upper()
b1 = b.upper()
d = ''
for i in c:
	if i in a:
		d += b[a.index(i)]
	elif i in a1:
		d += b1[a1.index(i)]
	else:
		d += i
print(d)


s1 = input()
s2 = input()
s3 = input()
(d, sf) = (dict(zip(list(s1), list(s2))), '')
for i in s3:
	if i.isupper():
		sf += d[i.lower()].upper()
	elif i.islower():
		sf += d[i]
	elif int(i) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]:
		sf += i
print(sf)


import sys
firstConfig = sys.stdin.readline()
secondConfig = sys.stdin.readline()
message = sys.stdin.readline()
for i in range(0, len(message) - 1):
	if message[i].isdigit():
		print(message[i], end='')
	elif message[i].isupper():
		lowercaseVersion = message[i].lower()
		position = 0
		while firstConfig[position] != lowercaseVersion:
			position = position + 1
		outputLowercase = secondConfig[position]
		outputFinal = outputLowercase.upper()
		print(outputFinal, end='')
	else:
		lowercaseletter = message[i]
		position = 0
		while firstConfig[position] != lowercaseletter:
			position = position + 1
		outputlower = secondConfig[position]
		print(outputlower, end='')
print()


s1 = input()
s2 = input()
t = input()
s = ''
for i in range(len(t)):
	if t[i] >= 'a' and t[i] <= 'z':
		if t[i] in s1:
			j = s1.index(t[i])
			s = s + s2[j]
	elif t[i] >= 'A' and t[i] <= 'Z':
		x = t[i].lower()
		j = s1.index(x)
		s = s + s2[j].upper()
	elif t[i] >= '0' and t[i] <= '9':
		s = s + t[i]
print(s)


a = input()
b = input()
s = input()
ans = ''
for l in s:
	if l.isalpha() == True:
		if l.isupper() == True:
			ans += b[a.index(l.lower())].upper()
		else:
			ans += b[a.index(l.lower())]
	else:
		ans += l
print(ans)


s = input()
n = input()
c = input()
d = {}
for i in range(26):
	d[s[i]] = n[i]
for i in c:
	l = ord(i)
	if l >= 65 and l <= 91:
		l += 32
		print(d[chr(l)].upper(), end='')
	elif l >= 97 and l <= 123:
		print(d[chr(l)], end='')
	else:
		print(i, end='')


a = input()
b = input()
d = {a[i]: b[i] for i in range(26)}
x = input()
s = ''
for j in x:
	if ord(j) >= 65 and ord(j) <= 90:
		j = j.swapcase()
		p = d[j]
		s += d[j].swapcase()
	elif ord(j) >= 97 and ord(j) <= 122:
		s += d[j]
	else:
		s += j
print(s)


s1 = input()
s2 = input()
s3 = input()
d = {}
for i in range(26):
	d[s1[i]] = s2[i]
for x in s3:
	c = d.get(x.lower(), x.lower())
	if x.isupper():
		c = c.upper()
	print(c, end='')


a = list(input())
b = list(input())
c = list(input())
d = []
for i in range(len(c)):
	if 64 < ord(c[i]) < 91:
		j = c[i].lower()
		m = a.index(j)
		d.append(b[m].upper())
	if 47 < ord(c[i]) < 58:
		d.append(c[i])
	if 96 < ord(c[i]) < 123:
		t = a.index(c[i])
		d.append(b[t])
print(''.join(d))


qwerty1 = input()
qwerty2 = input()
s = input()
qwerty1 += qwerty1.upper()
qwerty2 += qwerty2.upper()
result = []
for c in s:
	if c in qwerty1:
		index = qwerty1.index(c)
		sign = qwerty2[index]
		result.append(sign)
	else:
		result.append(c)
print(''.join(result))


def findPos(char, layout):
	for i in range(len(layout)):
		if layout[i] == char:
			return i
	return -1
layout1 = input()
layout2 = input()
s = input()
translatedS = ''
for c in s:
	if c.isdigit():
		desChar = c
	else:
		position = findPos(c.lower(), layout1)
		desChar = layout2[position]
	translatedS += desChar if c.islower() else desChar.upper()
print(translatedS)


import sys
from math import sqrt, floor, factorial
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def is_prime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if not n % i:
			return False
	return True

def solve():
	s1 = inp()
	s2 = inp()
	dic = {s1[i]: i for i in range(26)}
	for i in inp():
		print((s2[dic[i.lower()]].upper() if i.isupper() else s2[dic[i.lower()]]) if i.isalpha() else i, end='')
solve()


(first, sec, actual) = (input(), input(), input())
res = ''
for l in actual:
	if l.isnumeric():
		res += l
	elif l.isupper():
		res += sec[first.index(l.lower())].upper()
	else:
		res += sec[first.index(l)]
print(res)


layoutA = list(input())
layoutB = list(input())
text = list(input())
textFinal = ''
for character in text:
	if character.isdigit():
		textFinal += character
		continue
	elif character.upper() == character:
		textFinal += layoutB[layoutA.index(character.lower())].upper()
	else:
		textFinal += layoutB[layoutA.index(character)]
print(textFinal)


a = [ord(x) for x in list(input())]
b = [ord(x) for x in list(input())]
c = [ord(x) for x in list(input())]
for i in c:
	m = i
	flag = 0
	if i < 97 and i > 64:
		m += 32
		flag = 1
	if m in a:
		for j in range(26):
			if m == a[j]:
				if flag == 0:
					print(chr(b[j]), end='')
				else:
					print(chr(b[j] - 32), end='')
	elif i < 65:
		print(chr(i), end='')
	else:
		print(i, end='')


t1 = input()
t2 = input()
s1 = input()
s2 = s1[:].lower()
for i in range(len(s1)):
	if s1[i].isupper() and s1[i].isalpha():
		print(t2[t1.index(s2[i])].upper(), end='')
	elif s1[i].islower() and s1[i].isalpha():
		print(t2[t1.index(s2[i])], end='')
	else:
		print(s1[i], end='')


from sys import stdin
from sys import stdout
l = stdin.readline()
L = stdin.readline()
l = l + l.upper()
L = L + L.upper()
d = {l[i]: L[i] for i in range(len(l))}
t = stdin.readline()
q = [d[c] if c in d else c for c in t]
stdout.write(''.join(q) + '\n')


a = list(input())
b = list(input())
c = list(input())
l = []
for x in c:
	if x.lower() not in b:
		l.append(x)
	elif x not in b:
		l.append(b[a.index(x.lower())].upper())
	else:
		l.append(b[a.index(x)])
print(''.join(l))


lista = input()
lista2 = input()
palavra = input()
novaPalavra = ''
for i in range(len(lista)):
	lista2 += lista2[i].upper()
	lista += lista[i].upper()
for i in range(len(palavra)):
	if palavra[i] in lista:
		novaPalavra += lista2[lista.index(palavra[i])]
	else:
		novaPalavra += str(palavra[i])
print(novaPalavra)


x = input()
y = input()
z = input()
for i in range(0, len(z)):
	if z[i].isalpha():
		if z[i].isupper():
			a = z[i].lower()
			ind = x.find(a)
			print(y[ind].upper(), end='')
		else:
			ind = x.find(z[i])
			print(y[ind], end='')
	else:
		print(z[i], end='')


a = input()
b = input()
c = input()
lst = []
for i in range(len(c)):
	lst.append(c[i:i + 1])
count = 0
for lst[count] in c:
	if lst[count] in a:
		j = a.index(lst[count])
		print(b[j].lower(), end='')
	elif lst[count].casefold() in a:
		j = a.index(lst[count].casefold())
		print(b[j].upper(), end='')
	else:
		print(lst[count], end='')
	count = count + 1


s1 = input()
s2 = input()
a = {}
for i in range(len(s1)):
	a[s1[i].lower()] = s2[i].lower()
	a[s1[i].upper()] = s2[i].upper()
b = input()
for i in b:
	if i in a:
		print(a[i], end='')
	else:
		print(i, end='')


fst = input()
scnd = input()
a = dict(zip(fst, scnd))
q = a.keys()
cnrt = input()
l = []
for i in cnrt:
	if i.lower() in q:
		if i.isupper():
			l.append(a[i.lower()].upper())
		else:
			l.append(a[i])
	else:
		l.append(i)
print(''.join((x for x in l)))


s = input()
s1 = input()
s_1 = list(s.upper())
s1_1 = list(s1.upper())
s = list(s)
s1 = list(s1)
mp = {}
mp1 = {}
for a in range(len(s)):
	mp[s[a]] = s1[a]
	mp1[s_1[a]] = s1_1[a]
test = list(input())
result = ''
for a in range(len(test)):
	if test[a] in s:
		result += mp[test[a]]
	elif test[a] in s_1:
		result += mp1[test[a]]
	else:
		result += test[a]
print(result)


l1 = input()
l2 = input()
string = input()
mp = {}
for (a, b) in zip(l1, l2):
	mp[a] = b

def trans(c):
	if c.isalpha():
		r = mp[c.lower()]
		if c.isupper():
			return r.upper()
		else:
			return r
	else:
		return c
print(''.join(map(trans, string)))


a = input()
a.lower()
b = input()
b.lower()
c = input()
for i in c:
	if not i.isalpha():
		print(i, end='')
	else:
		f = i.isupper()
		o = b[a.index(i.lower())]
		if f:
			print(o.upper(), end='')
		else:
			print(o, end='')


s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
k = ''
all = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s3:
	j = all.find(i)
	if j != -1:
		if j > 25:
			o = all[j - 26]
			p = s1.find(o)
			k = k + all[all.find(s2[p]) + 26]
		else:
			p = s1.find(i)
			k = k + s2[p]
	else:
		k = k + i
print(k)


A = {}
B = {}
for (i, j) in enumerate(input()):
	A[j] = i
B = input()
for i in input():
	if not i.isalpha():
		print(i, end='')
		continue
	tmp = B[A[i.lower()]]
	if i.isupper():
		tmp = tmp.upper()
	print(tmp, end='')


n = input()
s = input()
t = input()
q = n.upper()
w = s.upper()
for i in range(len(t)):
	if t[i] in n:
		print(s[n.index(t[i])], end='')
	elif t[i] in q:
		print(w[q.index(t[i])], end='')
	else:
		print(t[i], end='')


(a, b, s) = (input(), input(), input())
a += a.upper()
b += b.upper()
tran = str.maketrans(a, b)
print(s.translate(tran))


a1 = input()
a2 = input()
t = input()
mapping = dict()
for i in range(26):
	mapping[a1[i]] = a2[i]
	mapping[a1[i].upper()] = a2[i].upper()
ans = ''
for ch in t:
	if ch in mapping:
		ans += mapping[ch]
	else:
		ans += ch
print(ans)


a = input()
b = input()
c = input()
d = dict(zip(a, b))
result = ''
for i in c:
	if i.isdigit():
		result += i
	elif i.isupper():
		result += d[i.lower()].upper()
	else:
		result += d[i]
print(result)


a = input()
b = input()
s = input()
num = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
for i in range(len(s)):
	if s[i] not in num:
		for j in range(26):
			if s[i].lower() == a[j]:
				if s[i].isupper():
					print(b[j].upper(), end='')
				else:
					print(b[j], end='')
	else:
		print(s[i], end='')


l1 = input()
l2 = input()
txt = input()
tr = {l1[i]: l2[i] for i in range(len(l1))}
for c in txt:
	if c.lower() in tr:
		t = tr[c.lower()]
		if not c.islower():
			t = t.upper()
	else:
		t = c
	print(t, end='')


str1 = input()
str2 = input()
d = {}
for i in range(26):
	d[str1[i]] = str2[i]
inp = input()
ans = ''
for i in range(len(inp)):
	if inp[i].isdigit():
		ans += inp[i]
	elif inp[i].islower():
		ans += d[inp[i]]
	else:
		ans += d[inp[i].lower()].upper()
print(ans)


s = input().lower()
z = input().lower()
c = input()
for i in range(len(c)):
	if c[i] == c[i].upper():
		if s.find(c[i].lower()) != -1:
			print(z[s.find(c[i].lower())].upper(), end='')
		else:
			print(c[i], end='')
	elif s.find(c[i].lower()) != -1:
		print(z[s.find(c[i])], end='')
	else:
		print(c[i], end='')


RNG1 = [chr(_) for _ in range(97, 123)]
RNG2 = [chr(_) for _ in range(65, 91)]
N1 = input()
N2 = input()
N3 = input()
for _ in range(len(N3)):
	if N3[_] in RNG1:
		print(N2[N1.index(N3[_])], end='')
	elif N3[_] in RNG2:
		print(chr(ord(N2[N1.index(chr(ord(N3[_]) + 32))]) - 32), end='')
	else:
		print(N3[_], end='')


def list_input():
	return list(map(int, input().split()))
a = input()
b = input()
s = input()
res = list()
for c in s:
	x = c
	lowered = False
	if 'A' <= x and x <= 'Z':
		x = x.lower()
		lowered = True
	p = a.find(x)
	if p == -1:
		res.append(x)
	elif lowered:
		res.append(b[p].upper())
	else:
		res.append(b[p])
print(''.join(map(str, res)))


a = input()
b = input()
c = input()
dic = {}
for i in range(26):
	dic[a[i]] = b[i]
d = ''
for i in range(len(c)):
	if c[i].lower() not in a:
		d += c[i]
	elif c[i].isupper():
		d += dic[c[i].lower()].upper()
	else:
		d += dic[c[i]]
print(d)


a = input()
b = input()
d = {x: y for (x, y) in zip(a + a.upper(), b + b.upper())}
o = ''
for c in input():
	if c in '1234567890':
		o += c
	else:
		o += d[c]
print(o)


(a, b, s) = (input(), input(), input())
d = {}
for i in range(len(a)):
	d[a[i]] = b[i]
ans = ''
for c in s:
	if c.isalpha():
		ans += d[c] if c.islower() else d[c.lower()].upper()
	else:
		ans += c
print(ans)


ch1 = input()
ch2 = input()
ch3 = input()
ch = ''
for i in ch3:
	trouve = True
	j = 0
	while j < len(ch1) and trouve:
		if ch1[j].upper() == i.upper():
			trouve = False
		else:
			j = j + 1
	if trouve == False:
		if ord(i) <= 90:
			ch = ch + ch2[j].upper()
		else:
			ch = ch + ch2[j]
	else:
		ch = ch + i
print(ch)


(from_, to_, s) = (input(), input(), input())
print(s.translate(''.maketrans(from_ + from_.upper(), to_ + to_.upper())))


first_layout = list(input())
second_layout = list(input())
raw_text = list(input())
final_text = ''
for letter in raw_text:
	if letter.isalpha():
		index = first_layout.index(letter.lower())
		if letter.isupper():
			final_text += second_layout[index].upper()
		else:
			final_text += second_layout[index]
	else:
		final_text += letter
print(final_text)


def main():
	v1 = list(input())
	v2 = list(input())
	d = input()
	res = ''
	for c in d:
		if c.isalpha():
			ind = v1.index(c.lower())
			res += v2[ind] if c.islower() else v2[ind].upper()
		else:
			res += c
	print(res)
main()


(eng, berlyandskyi) = (''.join([c + c.upper() for c in input()]), ''.join([c + c.upper() for c in input()]))
print(''.join([berlyandskyi[eng.index(c)] if c in eng else c for c in input()]))


(a, b, c) = (input(), input(), input())
for i in c:
	if i.isdigit():
		print(i, end='')
		continue
	z = i.lower()
	indice = a.index(z)
	if i.isupper():
		print(b[indice].upper(), end='')
	else:
		print(b[indice], end='')


a = [i for i in input('')]
b = [i for i in input('')]
t = [i for i in input('')]
x = 'abcdefghijklmnopqrstuvwxyz'
y = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in range(len(t)):
	if t[i] in x:
		ans += b[a.index(t[i])]
	elif t[i] in y:
		ans += b[a.index(t[i].lower())].upper()
	else:
		ans += t[i]
print(ans)


a = list(input())
b = list(input())
c = list(input())
res = ''
for lit in c:
	if lit not in a:
		if lit.lower() in a:
			res += b[a.index(lit.lower())].upper()
		else:
			res += str(lit)
	else:
		res += b[a.index(lit)]
print(res)


clav1 = input().strip()
clav2 = input().strip()
s = input().strip()
ans = ''
for el in s:
	if el in '0123456789':
		ans += el
		continue
	if el.islower():
		ans += clav2[clav1.find(el)]
	else:
		ans += clav2[clav1.find(el.lower())].upper()
print(ans)


(first, second) = (input(), input())
string = list(input())
lmap = {f: s for (f, s) in zip(first, second)}
for (i, e) in enumerate(string):
	if e.isdigit():
		continue
	if e.islower():
		string[i] = lmap[e]
	else:
		string[i] = lmap[e.lower()].upper()
print(''.join(string))


x = input()
y = input()
z = input()
r = z.lower()
z1 = []
for i in range(len(x)):
	k = ord(y[i]) - ord(x[i])
	z1.append(k)
for i in range(len(z)):
	if ord(z[i]) >= 48 and ord(z[i]) <= 57:
		print(z[i], end='')
		continue
	for j in range(len(x)):
		if r[i] == x[j]:
			print(chr(z1[j] + ord(z[i])), end='')
			break


kbord1 = list(input())
kbord2 = list(input())
text = list(input())
d = {}
for i in range(len(kbord1)):
	d[kbord1[i]] = kbord2[i]
new_str = ''
for i in text:
	if i.isupper():
		new_str += d[i.lower()].upper()
	elif i.islower and i in d:
		new_str += d[i]
	else:
		new_str += i
print(new_str)


def is_upper(ch):
	return 'A' <= ch <= 'Z'

def is_lower(ch):
	return 'a' <= ch <= 'z'

def to_lower(ch):
	return chr(ord(ch) + (ord('a') - ord('A')))

def to_upper(ch):
	return chr(ord(ch) - (ord('a') - ord('A')))
a = input()
b = input()
s = input()
s_ = ''
for i in range(len(s)):
	if is_lower(s[i]) or is_upper(s[i]):
		if is_upper(s[i]):
			ch = to_lower(s[i])
		else:
			ch = s[i]
		p = 0
		while p < len(a) and a[p] != ch:
			p += 1
		if is_upper(s[i]):
			s_ += to_upper(b[p])
		else:
			s_ += b[p]
	else:
		s_ += s[i]
print(s_)


first = input()
second = input()
text = input()
result = ''
i = 0
d = {}
for char in first:
	d[char] = i
	i += 1
for i in range(len(text)):
	if text[i] >= '0' and text[i] <= '9':
		result += text[i]
	elif text[i].isupper():
		result += second[d[text[i].lower()]].upper()
	else:
		result += second[d[text[i]]]
print(result)


nums = '0123456789'
s = input() + nums
s2 = input() + nums
s4 = input()
s2 += s2.upper()
s += s.upper()
ans = ''
for i in s4:
	ans += s2[s.find(i)]
print(ans)


a = input()
b = input()
k = ''
for i in input():
	if i.isnumeric():
		print(i, end='')
	elif i not in a:
		print(k + b[a.find(i.lower())].upper(), end='')
	else:
		print(b[a.index(i)], end='')


l1 = input()
L1 = l1.upper()
l2 = input()
L2 = l2.upper()
s = input()
d = dict(zip(l1 + L1, l2 + L2))
emp = ''
for i in s:
	if i in d.keys():
		emp += d[i]
	else:
		emp += i
print(emp)


s1 = input()
s2 = input()
s3 = input()
l = []
s = ''
for i in range(len(s1)):
	l.append((s1[i], s2[i]))
for k in range(len(s1)):
	l.append((s1[k].upper(), s2[k].upper()))
for x in range(len(s3)):
	for y in range(len(l)):
		if l[y][0] == s3[x]:
			s += l[y][1]
		elif s3[x].isdigit():
			s += s3[x]
			break
print(s)


first = input()
second = input()
request = input()
first_d = {}
second_d = {}
for (_, c) in enumerate(first):
	first_d[c] = _
for (_, c) in enumerate(second):
	second_d[_] = c
ans = ''
for c in request:
	lower_c = c.lower()
	if lower_c not in first:
		ans += c
	else:
		corr_c = second_d[first_d[lower_c]]
		if c.lower() == c:
			ans += corr_c
		else:
			ans += corr_c.upper()
print(ans)


s1 = input()
s2 = input()
p = input()
s1 = s1 + s1.upper()
s2 = s2 + s2.upper()
l = ''
for i in range(len(p)):
	if p[i] in s1:
		q = s1.index(p[i])
		l += s2[q]
	else:
		l += p[i]
print(l)


a = input()
b = input()
c = input()
f = ''
for i in c:
	if ord(i) >= 65:
		for j in range(len(a)):
			if i.lower() == a[j]:
				if i.isupper():
					f += b[j].upper()
				else:
					f += b[j]
	else:
		f += i
print(f)


board = dict(zip(input(), input()))
for c in input():
	if c.lower() not in board:
		print(c, end='')
	elif c.isupper():
		print(board[c.lower()].upper(), end='')
	else:
		print(board[c], end='')


a = input()
aa = []
for i in range(len(a)):
	aa.append(a[i])
for i in range(len(aa)):
	aa.append(aa[i].upper())
for i in range(10):
	aa.append(str(i))
b = input()
bb = []
for i in range(len(b)):
	bb.append(b[i])
for i in range(len(bb)):
	bb.append(bb[i].upper())
for i in range(10):
	bb.append(str(i))
s = input()
ss = []
o = ''
for i in range(len(s)):
	ss.append(s[i])
for i in range(len(ss)):
	j = aa.index(ss[i])
	o += bb[j]
print(o)


import sys
line_1 = sys.stdin.readline()
line_2 = sys.stdin.readline()
message = sys.stdin.readline()
result = ''
a = {}
for i in range(len(line_1)):
	a[line_1[i]] = line_2[i]
for i in message:
	if i.isalpha():
		if i.isupper():
			i = a[i.lower()]
			i = i.upper()
		else:
			i = a[i.lower()]
	result = result + i
sys.stdout.write(result)


l1 = list(input())
l2 = list(input())
out = list(input())
for i in out:
	if i.lower() in l1:
		if i.isupper():
			print(l2[l1.index(i.lower())].upper(), end='')
		else:
			print(l2[l1.index(i)], end='')
	else:
		print(i, end='')


p = input()
q = input()
t = input()
s = ''
for i in range(len(t)):
	if ord(t[i]) >= 65 and ord(t[i]) <= 90:
		x = t[i].lower()
		s = s + q[p.find(x)].upper()
	elif ord(t[i]) >= 97 and ord(t[i]) <= 122:
		s = s + q[p.find(t[i])]
	else:
		s = s + t[i]
print(s)


type1 = input()
l1 = []
dict1 = {}
i = 0
for each in type1:
	l1.append(each)
	dict1[each] = i
	i += 1
type2 = input()
l2 = []
dict2 = {}
i = 0
for each in type2:
	l2.append(each)
	dict2[i] = each
	i += 1
res = input()
rrr = []
for each in res:
	if each not in '1234567890':
		boo = each.isupper()
		each = each.lower()
		r = dict2[dict1[each]]
		if boo:
			rrr.append(r.upper())
		else:
			rrr.append(r.lower())
	else:
		rrr.append(each)
print(''.join(rrr))


k1 = input()
k2 = input()
stri = input()
for i in stri:
	if i.isdigit():
		print(i, end='')
	else:
		f = i.lower()
		l = k1.index(f)
		if i.isupper():
			print(k2[l].capitalize(), end='')
		else:
			print(k2[l], end='')


a = input()
b = input()
s = input()
d = dict(zip(a, b))
for c in s:
	if c.lower() in d:
		if c.islower():
			print(d[c], end='')
		else:
			print(d[c.lower()].upper(), end='')
	else:
		print(c, end='')


(a, b) = (input(), input())
print(input().translate(str.maketrans(a + a.upper(), b + b.upper())))


a = list(input())
b = list(input())
s = input()
a1 = []
for i in s:
	if i.isalpha():
		if i.isupper():
			a1.append(b[a.index(i.lower())].upper())
		else:
			a1.append(b[a.index(i)])
	else:
		a1.append(i)
print(''.join(a1))


def original_text(t, l1, l2):
	d = dict(zip(l1, l2))
	res = ''
	for c in t:
		if c.isupper():
			res += d[c.lower()].upper()
		elif c in d:
			res += d[c]
		else:
			res += c
	return res

def main():
	layout1 = input()
	layout2 = input()
	text = input()
	print(original_text(text, layout1, layout2))
main()


s1 = input()
s2 = input()
s3 = input()
for i in range(len(s3)):
	try:
		k = s1.index(s3[i].lower())
		if s3[i].lower() == s3[i]:
			print(s2[k], end='')
		else:
			print(s2[k].upper(), end='')
	except:
		print(s3[i], end='')


kb_a = input()
kb_b = input()
s = input()
kb_a = kb_a + kb_a.upper()
kb_b = kb_b + kb_b.upper()
d = dict(zip(kb_a, kb_b))
ans = ''
for let in s:
	ans += d.get(let, let)
print(ans)


a = str(input())
b = str(input())
c = str(input())
a1 = a.upper()
b1 = b.upper()
d = len(c)
x = int(0)
g = str('')
while x < d:
	e = a.find(c[x])
	if e != -1:
		g = g + b[e]
	elif a1.find(c[x]) != -1:
		k = a1.find(c[x])
		g = g + b1[k]
	else:
		g = g + c[x]
	x = x + 1
print(g)


s1 = input()
s2 = input()
s3 = input()
ans = ''
for x in s3:
	i = s1.find(x.lower())
	if i == -1:
		ans += x
	elif x.isupper():
		ans += s2[i].upper()
	else:
		ans += s2[i]
print(ans)


s1 = list(input())
s2 = list(input())
x = input()
need = []
x1 = list(x.lower())
for i in range(len(x)):
	if x[i].islower():
		need.append(s2[s1.index(x1[i])].lower())
	elif x[i].isnumeric():
		need.append(x[i])
	else:
		need.append(s2[s1.index(x1[i])].upper())
for j in range(len(need)):
	print(need[j], end='')


q = list(input())
r = list(input())
s = list(input())
y = ''
for i in s:
	if i.isalpha():
		x = q.index(i.lower())
		if i.isupper():
			y += str(r[x]).upper()
		else:
			y += r[x].lower()
	else:
		y += i
print(y)


(layout1, layout2) = (input(''), input(''))
converter = {}
for i in range(len(layout1)):
	converter[layout1[i]] = layout2[i]
(inp, ans) = (input(''), '')
for x in inp:
	x_0 = ''
	if x.isdigit():
		x_0 = x
	elif str(x).istitle():
		x_0 = converter[x.lower()]
		x_0 = x_0.upper()
	else:
		x_0 = converter[x]
	ans = ''.join([ans, x_0])
print(ans)


s1 = input()
s2 = input()
dic = {}
for i in range(26):
	dic[s1[i]] = s2[i]
s = input()
val = [0 for i in range(0, 10000)]
for i in range(len(s)):
	if s[i].upper() == s[i]:
		val[i] = 1
ans = []
s = s.lower()
for i in s:
	if i in s1:
		ans += [dic[i]]
	else:
		ans += [i]
for i in range(0, len(s)):
	if val[i] == 1:
		ans[i] = ans[i].upper()
print(''.join(ans))


a = list(input())
b = list(input())
c = input()
ans = ''
d = dict(zip(a, b))
for x in c:
	if x.isnumeric():
		ans += x
	elif x.isupper():
		y = x.lower()
		ans += d[y].upper()
	else:
		ans += d[x]
print(ans)


a = list(input())
b = list(input())
c = list(input())
dictonary = dict(zip(a, b))
ans = ''
for i in c:
	if i.isdigit():
		ans += i
		continue
	ans += dictonary[i.lower()] if i.islower() else dictonary[i.lower()].upper()
print(ans)


a = input() + '0123456789'
b = input() + '0123456789'
c = list(input())
res = ''
for i in c:
	if i.isupper():
		i = i.lower()
		res += str(b[a.find(str(i))]).upper()
	else:
		res += str(b[a.find(str(i))])
print(res)


layout1 = input()
layout3 = layout1.upper()
layout2 = input()
text = input()
out = ''
for i in text:
	if i.isdigit():
		out += i
	elif i.isupper():
		out += layout2[layout1.find(i.lower())].upper()
	else:
		out += layout2[layout1.find(i.lower())]
print(out)


l1 = input()
l1 += l1.upper()
l2 = input()
l2 += l2.upper()
s = input()
for x in s:
	if ord(x) < 65:
		print(x, end='')
	else:
		print(l2[l1.index(x)], end='')
print()


import _string
s = input()
s1 = input()
s2 = input()
hassan = ''
index2 = -1
for i in s2:
	if i == '0' or i == '1' or i == '2' or (i == '3') or (i == '4') or (i == '5') or (i == '6') or (i == '7') or (i == '8') or (i == '9'):
		hassan += i
		continue
	if i.isupper():
		index1 = s.index(i.lower())
		hassan += s1[index1].upper()
		continue
	else:
		index1 = s.index(i.lower())
		hassan += s1[index1]
		continue
print(hassan)


s1 = input()
s2 = input()
s1U = s1.upper()
s2U = s2.upper()
t = input()
res = []
dL = {}
dU = {}
nums = [str(i) for i in range(10)]
for i in range(26):
	dL[s1[i]] = s2[i]
	dU[s1U[i]] = s2U[i]
for ch in t:
	if ch in nums:
		res.append(ch)
		continue
	if ch.islower():
		res.append(dL[ch])
	else:
		res.append(dU[ch])
print(''.join(res))


s1 = input()
s2 = input()
s = input()
for x in s:
	if x == '0' or x == '1' or x == '2' or (x == '3') or (x == '4') or (x == '5') or (x == '6') or (x == '7') or (x == '8') or (x == '9'):
		print(x, end='')
	elif 'A' <= x <= 'Z':
		print(s2[s1.index(x.lower())].upper(), end='')
	else:
		print(s2[s1.index(x.lower())], end='')
print()


a = list(input())
b = list(input())
c = input()
for x in range(len(c)):
	if 64 < ord(c[x]) < 91:
		d = chr(ord(c[x]) + 32)
		e = b[a.index(d)]
		print(chr(ord(e) - 32), end='')
	elif 96 < ord(c[x]) < 123:
		print(b[a.index(c[x])], end='')
	else:
		print(c[x], end='')


firstLayout = input()
secondLayout = input()
firstText = input()
keyMap = {}
for i in range(26):
	keyMap[firstLayout[i]] = secondLayout[i]
secondText = ''
for letter in firstText:
	if letter.isupper():
		secondText += keyMap[letter.lower()].upper()
	elif letter.islower():
		secondText += keyMap[letter]
	else:
		secondText += letter
print(secondText)


s1 = input()
s2 = input()
s3 = input()
s1 += s1.upper()
s2 += s2.upper()
for i in range(len(s3)):
	j = s1.find(s3[i])
	if j == -1:
		print(s3[i], end='')
	else:
		print(s2[j], end='')


a = input()
b = input()
c = input()
s = ''
for i in c:
	j = i.lower()
	t = a.find(j)
	if t == -1:
		s = s + i
	elif i.isupper():
		s = s + b[t].upper()
	else:
		s = s + b[t]
print(s)


s1 = str(input())
s2 = str(input())
s = str(input())
s1 = list(s1)
s2 = list(s2)
for l in s:
	f = 0
	if l.isupper():
		f = 1
		l = l.lower()
	if l in s1:
		a = s1.index(l)
		b = s2[a]
		if f == 1:
			print(b.upper(), end='')
		else:
			print(b, end='')
	elif f == 1:
		print(l.upper(), end='')
	else:
		print(l, end='')


ras1 = input()
ras2 = str(input())
str1 = input()
answer = ''
for i in str1:
	if i not in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']:
		number = ras1.index(i.lower())
		a = ras2[number].upper()
		if i.upper() == i:
			answer += ras2[number].upper()
		else:
			answer += str(ras2[number])
	else:
		answer += i
print(answer)


first = list(input())
second = list(input())
word = list(input())
saida = ''
for v in word:
	if v in first and v.lower() == v:
		saida = saida + second[first.index(v)]
	elif v.lower() in first and v.upper() == v:
		saida = saida + second[first.index(v.lower())].upper()
	else:
		saida += v
print(saida)


lay1 = input('')
lay2 = input('')
txt = input('')
nums = '0123456789'
res = ''
for i in range(len(txt)):
	if txt[i] in nums:
		res += txt[i]
	elif txt[i].upper() == txt[i]:
		res += lay2[lay1.find(txt[i].lower())].upper()
	else:
		res += lay2[lay1.find(txt[i])]
print(res)


x = input()
y = input()
t = input()
r = ''
for i in t:
	if i.isupper():
		w = i.lower()
		for j in range(26):
			if x[j] == w:
				r = r + y[j].upper()
	elif i.islower():
		for j in range(26):
			if x[j] == i:
				r = r + y[j]
	else:
		r = r + i
print(r)


I = input
(A, B) = (I(), I())
d = dict(zip(A + A.upper(), B + B.upper()))
for c in I():
	print(d[c] if c in d else c, end='')


a = list(input())
b = list(input())
n = input()
z = n.lower()
for i in range(1, len(n) + 1):
	if z[i - 1].isalpha():
		q = a.index(z[i - 1])
		if n[i - 1].isupper():
			t = b[q].upper()
			n = n[:i - 1] + t + n[i:]
		elif n[i - 1].islower():
			t = b[q].lower()
			n = n[:i - 1] + t + n[i:]
print(n)


a = input()
b = input()
c = input()
s = ''
for i in c:
	if i >= 'A' and i <= 'Z':
		k = ord(i)
		k = k + 32
		k = chr(k)
		u = a.find(k)
		p = b[u]
		p = ord(p)
		p = p - 32
		p = chr(p)
		s += p
	elif i >= 'a' and i <= 'z':
		u = a.find(i)
		p = b[u]
		s += p
	else:
		s += i
print(s)


O = input()
N = input()
S = input()
F = []
P = ''
for i in range(len(S)):
	if S[i].isupper():
		F.append(i)
L = S.lower()
e = []
for i in L:
	if i in O:
		e.append(N[O.index(i)])
	else:
		e.append(i)
for i in F:
	e[i] = e[i].upper()
for i in e:
	P += i
print(P)


layout1 = input()
layout2 = input()
test = input()
d = {}
res = ''
for i in range(len(layout1)):
	d[layout1[i]] = layout2[i]
for i in test:
	try:
		if i.islower():
			res = res + d[i]
		elif i.isupper():
			res = res + d[i.lower()].upper()
		else:
			res = res + i
	except:
		pass
print(res)


first = input()
second = input()
mes = input()
message = []
for bar in range(len(mes)):
	message.append(mes[bar])
msg = ''
figures = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
check_to_up = 0
for foo in range(len(message)):
	if message[foo] in figures:
		msg += message[foo]
	else:
		if message[foo].isupper():
			check_to_up = 1
			message[foo] = message[foo].lower()
		letter = second[first.index(message[foo])]
		if check_to_up == 1:
			letter = letter.upper()
			check_to_up = 0
		msg += letter
print(msg)


s1 = input()
s2 = input()
s = input()
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
brojevi = '0123456789'
ind = 0
kr = ''
r = ''
for i in range(len(s)):
	if s[i] in s1 and s[i] not in brojevi:
		r = s[i]
	elif s[i] in abc:
		r = s[i].lower()
	ind = s1.index(r)
	if s[i] == r:
		kr += s2[ind]
	elif s[i] in brojevi:
		kr += s[i]
	else:
		kr += s2[ind].upper()
print(kr)


string1 = input()
string2 = input()
string3 = input()
string4 = ''
for i in range(len(string3)):
	ind = string1.find(string3[i].lower())
	if string3[i].isupper() == True and string3[i].isdigit() == False:
		string4 += string2[ind].upper()
	elif string3[i].isupper() == False and string3[i].isdigit() == False:
		string4 += string2[ind].lower()
	else:
		string4 += string3[i]
print(string4)


klava1 = input()
KLAVA1 = klava1.upper()
klava2 = input()
KLAVA2 = klava2.upper()
text = input()
text_reformed = str()
for x in text:
	if x in klava1:
		text_reformed += klava2[klava1.find(x)]
	elif x in KLAVA1:
		text_reformed += KLAVA2[KLAVA1.find(x)]
	else:
		text_reformed += x
print(text_reformed)


al1 = input()
al2 = input()
word = input()
newWord = ''
for el in word:
	if el.isdigit():
		newWord += el
	elif el.isupper():
		pos = al1.find(el.lower())
		newWord += al2[pos].upper()
	else:
		pos = al1.find(el)
		newWord += al2[pos]
print(newWord)


def createLetterMap(layout1, layout2):
	letterMap = {}
	for i in range(len(layout1)):
		letterMap[layout1[i]] = layout2[i]
	return letterMap

def transformText(layout1, layout2, text):
	result = []
	letterMap = createLetterMap(layout1, layout2)
	for letter in text:
		if letter.isalpha():
			if letter.isupper():
				result.append(letterMap[letter.lower()].upper())
			else:
				result.append(letterMap[letter])
		else:
			result.append(letter)
	return ''.join(result)
layout1 = input()
layout2 = input()
text = input()
print(transformText(layout1, layout2, text))


fkey = list(map(str, input()))
lkey = list(map(str, input()))
ans = list(input())
ups = []
for i in range(len(ans)):
	if ans[i].isupper():
		ups.append(i)
	if ans[i].lower() in lkey:
		ans[i] = lkey[fkey.index(ans[i].lower())]
for f in ups:
	ans[f] = ans[f].upper()
print(''.join(ans))


import sys

def save_case(c: str, x: str) -> str:
	if x.islower():
		return c
	return c.upper()

def solve(test):
	(board1, board2, text) = test.split()
	board_map = {board1[i]: c for (i, c) in enumerate(board2)}
	return ''.join(map(lambda x: save_case(board_map.get(x.lower(), x), x), text))

def get_input():
	return sys.stdin.read()

def go():
	print(solve(get_input()))
go()


def convert(layout1, layout2, text):
	result = ''
	for letter in text:
		if letter.lower() in layout1:
			if letter.lower() == letter:
				result += layout2[layout1.index(letter.lower())]
			else:
				result += layout2[layout1.index(letter.lower())].upper()
		else:
			result += letter
	return result
first = input()
second = input()
string = input()
print(convert(first, second, string))


ch1 = input()
ch2 = input()
res = ''
s = input()
for i in range(len(s)):
	if s[i].isalpha() == False:
		res += s[i]
	elif s[i].islower():
		res += ch2[ch1.index(s[i])]
	else:
		res += ch2[ch1.index(s[i].lower())].upper()
print(res)


string1 = input()
string2 = input()
s = input()
for i in range(len(s)):
	if '0' <= s[i] <= '9':
		print(s[i], end='')
	else:
		ascii_code = ord(s[i])
		if 65 <= ascii_code <= 90:
			ascii_code += 32
			char = chr(ascii_code)
			index = string1.find(char)
			cap_ascii_code = ord(string2[index])
			cap_ascii_code -= 32
			print(chr(cap_ascii_code), end='')
		else:
			print(string2[string1.find(s[i])], end='')


proto_s = input()
post_s = input()
just_s = input()
d = {}
for i in range(26):
	d.setdefault(proto_s[i], post_s[i])
res = ''
for j in just_s:
	if j in d:
		res += d[j]
	elif j.lower() in d:
		res += str(d[j.lower()]).upper()
	else:
		res += j
print(res)


a = input()
b = input()
c = {}
for i in range(len(a)):
	c[a[i]] = b[i]
t = input()
s = ''
for i in range(len(t)):
	if t[i].isdigit():
		s += t[i]
	elif t[i].isupper():
		s += c[t[i].lower()].upper()
	else:
		s += c[t[i]]
print(s)


s = input()
t = input()
r = input()
p = r
ini = True
string = ''
for i in range(len(r)):
	if r[i].isdigit():
		string += r[i]
	elif p[i].isupper():
		string += t[s.find(r[i].lower())].upper()
	else:
		string += t[s.find(r[i].lower())]
print(string)


layout1 = input().rstrip()
layout2 = input().rstrip()
text = input().rstrip()
new_text = list()
for i in range(len(text)):
	if 'a' <= text[i] <= 'z' or 'A' <= text[i] <= 'Z':
		if text[i].isupper():
			ind = layout1.find(text[i].lower())
			new_text.append(layout2[ind].upper())
		else:
			ind = layout1.find(text[i])
			new_text.append(layout2[ind])
	else:
		new_text.append(text[i])
print(''.join(new_text))


(s1, s2) = (input().strip(), input().strip())
t = input().strip()
m_lower = dict(zip(s1, s2))
m_upper = dict(zip(map(str.upper, s1), map(str.upper, s2)))
nums = list(map(str, range(10)))
m_numbs = dict(zip(nums, nums))
m = dict()
m.update(m_lower)
m.update(m_upper)
m.update(m_numbs)
res = list(map(lambda x: m[x], t))
print(''.join(res))


def layout():
	a = input()
	a = a.upper() + a
	a = list(a)
	b = input()
	b = b.upper() + b
	b = list(b)
	s = input()
	res = ''
	for each_item in s:
		if each_item in a:
			inx = a.index(each_item)
			res += b[inx]
		else:
			res += each_item
	return res
print(layout())


f = input()
s = input()
t = input()
d = {}
for i in range(len(f)):
	d[f[i]] = s[i]
	d[f[i].upper()] = s[i].upper()
for i in t:
	if ord(i) >= 65 and ord(i) <= 90 or (ord(i) >= 97 and ord(i) <= 122):
		print(d[i], end='')
	else:
		print(i, end='')


def keyboard():
	fList = []
	tList = []
	iList = []
	oList = []
	F = input()
	T = input()
	I = input()
	fList = list(F)
	tList = list(T)
	iList = list(I)
	for x in iList:
		if x in fList:
			oList.append(tList[fList.index(x)])
		elif x.swapcase() in fList:
			oList.append(tList[fList.index(x.swapcase())].swapcase())
		else:
			oList.append(x)
	print(''.join(oList))
keyboard()


x = input()
y = input()
s3 = input()
for i in s3:
	if i in '0123456789':
		print(i, end='')
	else:
		t = y[x.index(i.lower())]
		if i == i.lower():
			print(t, end='')
		else:
			print(t.upper(), end='')


s1 = input()
s2 = input()
t = input()
res = ''
for i in range(len(t)):
	if t[i].lower() in s2:
		if t[i].isupper():
			res += s2[s1.index(t[i].lower())].upper()
		else:
			res += s2[s1.index(t[i].lower())]
	else:
		res += t[i]
print(res)


a = input()
b = input()
c = input()
for i in c:
	if not i.isalpha():
		print(i, end='')
		continue
	if i.isupper():
		flag = True
	else:
		flag = False
	place = a.find(i.lower())
	if flag:
		print(b[place].upper(), end='')
	else:
		print(b[place], end='')


def num(k):
	global alp, alp2
	ind = alp.index(k.lower())
	return chr(ord(k) - ord(k.lower()) + ord(alp2[ind]))
alp = list(input())
alp2 = list(input())
text = list(input())
print(''.join((num(i) if i.lower() in alp else i for i in text)))


a = input()
b = input()
d = {}
for i in range(len(a)):
	d[a[i]] = b[i]
	d[a[i].upper()] = b[i].upper()
c = input()
for i in c:
	if i in d:
		print(d[i], end='')
	else:
		print(i, end='')


a = input()
b = input()
c = input()
d = {}
s = ''
for i in range(26):
	d[a[i]] = b[i]
for i in c:
	if i.isdigit():
		s += i
	elif i.isupper():
		s += d[i.lower()].upper()
	else:
		s += d[i]
print(s)


s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
s_output = ''
for i in s3:
	index = s1.find(i.lower())
	if i.isdigit():
		s_output += i
	elif i.isupper():
		s_output += s2[index].upper()
	else:
		s_output += s2[index]
print(s_output)


(s1, s2, real) = (input(), input(), input())
for i in real:
	if i.isupper():
		print(s2[s1.index(i.lower())].upper(), end='')
	elif i.islower():
		print(s2[s1.index(i)].lower(), end='')
	else:
		print(i, end='')


a = input()
b = input()
d1 = {a[i]: b[i] for i in range(len(a))}
d2 = {chr(ord(a[i]) - 32): chr(ord(b[i]) - 32) for i in range(len(a))}
ans = ''
s = input()
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) < 97 + 26:
		ans += d1[s[i]]
	elif ord(s[i]) >= 65 and ord(s[i]) < 65 + 26:
		ans += d2[s[i]]
	else:
		ans += s[i]
print(ans)


str_a = input()
str_b = input()
str_c = input()
str_a += str_a.upper()
str_b += str_b.upper()
translation = str.maketrans(str_a, str_b)
print(str_c.translate(translation))


import sys
layout1 = sys.stdin.readline().strip()
layout2 = sys.stdin.readline().strip()
output = sys.stdin.readline().strip()
for c in output:
	if c.isalpha():
		idx = layout1.find(c.lower())
		if c.islower():
			print(layout2[idx], end='')
		else:
			print(layout2[idx].upper(), end='')
	else:
		print(c, end='')
print('')


s1 = input()
s2 = input()
t = input()
d = {}
for i in range(len(s1)):
	d[s1[i]] = s2[i]
	d[s1[i].upper()] = s2[i].upper()
for i in range(10):
	d[str(i)] = str(i)
ans = ''
for i in range(len(t)):
	ans += d[t[i]]
print(ans)


s1 = input()
s2 = input()
s = input()
m = dict(zip(s1, s2))
m.update(dict(zip(s1.upper(), s2.upper())))
for i in s:
	if '0' <= i <= '9':
		print(i, end='')
	else:
		print(m[i], end='')


str1 = input()
str2 = input()
str3 = input()
for i in range(len(str3)):
	if str3[i].isalpha():
		if str3[i].isupper():
			x = str1.find(str3[i].lower())
			print(str2[x].upper(), end='')
		else:
			x = str1.find(str3[i])
			print(str2[x], end='')
	if str3[i].isdigit():
		print(str3[i], end='')


S1 = input()
S2 = input()
L1 = list(S1)
L2 = list(S2)
s = input()
L = list(s)
l = list(s.lower())
S = ''
for i in range(len(l)):
	if 48 <= ord(l[i]) <= 57:
		S += l[i]
	else:
		for j in range(len(L1)):
			if L1[j] == l[i]:
				S += L2[j]
			else:
				continue
l3 = list(S)
for i in range(len(L)):
	if L[i].isupper() == True:
		l3[i] = l3[i].upper()
	else:
		l3[i] = l3[i].lower()
print(''.join(l3))


first = input()
second = input()
match = {}
for i in range(26):
	match[first[i]] = second[i]
	match[first[i].upper()] = second[i].upper()
conv = input()
ans = ''
for x in conv:
	if x in '0123456789':
		ans += x
	else:
		ans += match[x]
print(ans)


a = input()
b = input()
c = input()
for i in c:
	try:
		print(b[a.index(i.lower())].upper(), end='') if i.istitle() else print(b[a.index(i.lower())], end='')
	except ValueError:
		print(i, end='')


def translate(first_key, second_key, string):
	trans = dict()
	for i in range(10):
		trans[str(i)] = str(i)
	trans[' '] = ' '
	for (f, s) in zip(first_key, second_key):
		trans[f.lower()] = s.lower()
		trans[f.upper()] = s.upper()
	out = ''
	for c in list(string):
		out += trans[c]
	return out
k1 = input().strip()
k2 = input().strip()
string = input().strip()
print(translate(k1, k2, string))


s = input()
s1 = input()
for i in range(26):
	s += chr(ord(s[i]) - 32)
	s1 += chr(ord(s1[i]) - 32)
text = input()
o = ''
for i in text:
	if 47 < ord(i) < 58:
		o += i
	else:
		for j in range(52):
			if s[j] == i:
				o += s1[j]
				break
print(o)


c = input()
am = input()
s = input()
d = {}
ch = ''
for i in range(len(c)):
	d[c[i].upper()] = am[i].upper()
	d[c[i].lower()] = am[i].lower()
for i in s:
	if i.isdigit():
		ch += i
	else:
		ch += d[i]
print(ch)


a = input()
b = input()
A = a.upper()
B = b.upper()
d = dict(zip(list(a + A), list(b + B)))
s = list(input())
ans = list(map(lambda x: d[x] if x in d else x, s))
print(''.join(ans))


wrong = input()
right = input()
d = {}
for i in range(len(wrong)):
	d[wrong[i]] = right[i]
	d[wrong[i].upper()] = right[i].upper()
msg = input()
msg = list(msg)
for i in range(len(msg)):
	if msg[i] in d:
		msg[i] = d[msg[i]]
ans = ''.join(msg)
print(ans)


s1 = input()
s2 = input()
D = {}
for i in range(26):
	D[s1[i]] = s2[i]
	D[s1[i].upper()] = s2[i].upper()
for i in input():
	if i >= '0' and i <= '9':
		print(i, end='')
	else:
		print(D[i], end='')


first_string = input()
second_string = input()
check_string = input()
result = ''
for i in check_string:
	if i.lower().isalpha():
		if i.islower():
			result += second_string[first_string.index(i.lower())]
		else:
			result += second_string[first_string.index(i.lower())].upper()
	if i.isdigit():
		result += i
print(result)


d = {}
for (a, b) in zip(input(), input()):
	d[a] = b
	d[a.upper()] = b.upper()
print(''.join([d[c] if c in d else c for c in input()]))


k1 = input()
k2 = input()
s = input()
ans = ''
for char in s:
	if char.isnumeric():
		ans += char
	elif char.isupper():
		ans += k2[k1.index(char.lower())].upper()
	else:
		ans += k2[k1.index(char)]
print(ans)


s1 = input()
s2 = input()
s = input()
d = {}
for i in range(26):
	d[s1[i]] = s2[i]
	d[s1[i].upper()] = s2[i].upper()
for el in s:
	if not el.isnumeric():
		print(d[el], end='')
	else:
		print(el, end='')


O = input()
D = input()
S = input()
maps = {}
for i in range(len(O)):
	maps[O[i]] = D[i]
ans = []
for s in S:
	if 65 <= ord(s) and ord(s) <= 90 or (97 <= ord(s) and ord(s) <= 122):
		if 65 <= ord(s) and ord(s) <= 90:
			ans += [maps[s.lower()].upper()]
		else:
			ans += [maps[s.lower()]]
	else:
		ans += s
print(''.join(ans))


a = input()
b = input()
d = {a[i]: b[i] for i in range(26)}
c = input()
x = ''
for i in range(len(c)):
	if c[i].islower():
		x += d[c[i]]
	elif c[i].isnumeric():
		x += c[i]
	else:
		x += d[c[i].lower()].upper()
print(x)


inp1 = input()
inp2 = input()
inp3 = input()
new = ''
for symbol in inp3:
	if symbol.isalpha():
		if symbol.isupper():
			new += inp2[inp1.index(symbol.lower())].upper()
		else:
			new += inp2[inp1.index(symbol)]
	else:
		new += symbol
print(new)


r1 = list(str(input()))
r2 = list(str(input()))
s = str(input())
for i in range(len(s)):
	f = s[i].lower()
	if r1.count(f) == 0:
		print(s[i], end='')
	elif s[i] != f:
		print(r2[r1.index(f)].upper(), end='')
	else:
		print(r2[r1.index(f)], end='')


s1 = input()
s2 = input()
s3 = input()
s1u = s1.upper()
s2u = s2.upper()
m = dict()
for i in range(26):
	m[s1[i]] = s2[i]
	m[s1u[i]] = s2u[i]
for c in s3:
	if c not in m.keys():
		print(c, end='')
	else:
		print(m[c], end='')


s1 = input()
s2 = input()
s3 = input()
f = []
for i in range(len(s3)):
	if s3[i].isupper():
		x = s3[i].lower()
		q = s1.index(x)
		f.append(s2[q].upper())
	elif s3[i].islower():
		q = s1.index(s3[i])
		f.append(s2[q])
	elif s3[i].isdigit():
		f.append(s3[i])
print(*f, sep='')


layoutA = input()
layoutB = input()
layoutA += layoutA.upper()
layoutB += layoutB.upper()
message = input()
mapping = {layoutA[i]: layoutB[i] for i in range(len(layoutA))}
answer = ''
for c in message:
	try:
		answer += mapping[c]
	except:
		answer += c
print(answer)


I = lambda : map(int, input().split())
l1 = input()
l2 = input()
l1 += l1.upper()
l2 += l2.upper()
s = input()
s = ''.join([l2[l1.index(i)] if i in l1 else i for i in s])
print(s)


prae1 = input()
prae2 = input()
py = input()
ct = ''
for i in py:
	check = 0
	if i.isupper():
		check = 1
	if i.lower() in prae1:
		c = prae2[prae1.find(i.lower())]
		if check == 1:
			c = c.upper()
		ct += c
	else:
		ct += i
print(ct)


S = str(input())
chars = []
chars2 = []
chars3 = []
chars4 = []
chars5 = []
chars7 = []
chars6 = []
chars8 = []
count2 = ''
for i in S:
	chars.append(i)
S2 = str(input())
S3 = str(input())
for i in S2:
	chars2.append(i)
for i in S3:
	chars3.append(i)
for i in range(0, len(chars3)):
	if chars.count(chars3[i].lower()) != 0:
		chars4.append(chars.index(chars3[i].lower()))
	else:
		chars5.append(chars3[i])
		chars8.append(i)
count = ''
for i in range(0, len(chars4)):
	count = count + str(chars2[chars4[i]])
for i in count:
	chars7.append(i)
for i in range(0, len(chars5)):
	chars7.insert(chars8[i], chars5[i])
for i in range(0, len(chars3)):
	if chars3[i] == chars3[i].upper():
		chars6.append(i)
for i in range(0, len(chars6)):
	chars7[chars6[i]] = chars7[chars6[i]].upper()
for i in range(0, len(chars7)):
	count2 = count2 + str(chars7[i])
print(count2)


first = input()
first += first.upper()
second = input()
second += second.upper()
t = input()
d = dict()
for i in range(52):
	d[str(first[i])] = i
for char in t:
	if char in second:
		print(second[d[char]], end='')
	else:
		print(char, end='')


Layout1 = input()
Layout2 = input()
MyDict = dict()
for i in range(0, 26):
	MyDict[Layout1[i]] = Layout2[i]
	MyDict[Layout1[i].upper()] = Layout2[i].upper()
	if i < 10:
		MyDict[str(i)] = str(i)
Sentence = input()
Result = []
for i in Sentence:
	Result.append(MyDict[i])
print(*Result, sep='')


(a, b, c) = (input(), input(), input())
d = dict(zip(a + a.upper(), b + b.upper()))
x = ''
for s in c:
	x = x + d.get(s, s)
print(x)


a = input()
b = input()
s = input()
for i in range(len(s)):
	if s[i] in a:
		print(b[a.index(s[i])], end='')
	elif s[i] in '0123456789':
		print(s[i], end='')
	else:
		k = chr(ord(s[i]) + 32)
		t = b[a.index(k)]
		print(chr(ord(t) - 32), end='')


s1 = input()
s2 = input()
s = input()
res = ''
for x in s:
	if 'A' <= x <= 'Z':
		res += s2[s1.index(x.lower())].upper()
	elif 'a' <= x <= 'z':
		res += s2[s1.index(x)]
	else:
		res += x
print(res)


(a, b) = (input(), input())
d = dict(zip(a, b))
d.update(zip(a.upper(), b.upper()))
print(*[c if c.isdigit() else d[c] for c in input()], sep='')


def KeyBoard(First, Second, type):
	res = ''
	for i in range(len(type)):
		c = type[i].lower()
		if c in First:
			j = First.index(c)
			if type[i].islower() == True:
				res = res + Second[j].lower()
			else:
				res = res + Second[j].upper()
		else:
			res = res + type[i]
	return res
x = input()
y = input()
z = input()
print(KeyBoard(x, y, z))


first = input()
second = input()
t = input()
o = ''
for i in t:
	if i.lower() not in first:
		o += i
	elif i.isupper():
		o += second[first.index(i.lower())].upper()
	else:
		o += second[first.index(i)]
print(o)


x = input()
y = list(x)
a = input()
b = list(a)
m = input()
n = list(m)
z = len(m)
result = ''
for i in range(z):
	r = n[i]
	if r.isdigit() == True:
		result = result + str(r)
	else:
		u = r.lower()
		t = y.index(u)
		if r.isupper() == True:
			l = b[t]
			d = l.upper()
			result = result + d
		else:
			result = result + b[t]
print(result)


a1 = input()
a2 = input()
a3 = input()
d = dict()
re = ''
for i in range(len(a1)):
	d[a1[i]] = a2[i]
for a in a3:
	if a.isalpha():
		if a.isupper():
			re += d[a.lower()].upper()
		else:
			re += d[a]
	else:
		re += a
print(re)


key = str(input())
sub = str(input())
main = str(input())
cont = {}
for i in range(len(key)):
	cont[key[i]] = sub[i]
new = []
for i in main:
	if i.isupper():
		new.append(cont[i.lower()].upper())
	if i.islower():
		new.append(cont[i])
	if not i.isalpha():
		new.append(i)
print(*new, sep='')


L1 = input()
L2 = input()
D = {}
for i in range(26):
	D[L1[i]] = L2[i]
S = ''
for i in input():
	if i in '0123456789':
		S += i
		continue
	if i.isupper():
		S += D[i.lower()].upper()
		continue
	else:
		S += D[i]
print(S)


s1 = list(input())
s2 = list(input())
l = input()
dict = {}
for i in range(26):
	dict[s1[i]] = s2[i]
ans = ''
for i in l:
	if not (65 <= ord(i) <= 90 or 97 <= ord(i) <= 122):
		ans += i
	elif i != i.lower():
		ans += dict[i.lower()].upper()
	else:
		ans += dict[i]
print(ans)


original = input()
new = input()
target = input()
for l in target:
	if l.isalpha():
		new_l = new[original.index(l.lower())]
		if l.isupper():
			print(new_l.upper(), end='')
		else:
			print(new_l, end='')
	else:
		print(l, end='')


a = input()
b = input()
c = input()
for i in range(0, len(c)):
	x = True
	for j in range(0, len(a)):
		if a[j] == c[i]:
			x = False
			print(b[j], end='')
		elif a[j] == c[i].lower():
			x = False
			print(b[j].upper(), end='')
	if x:
		print(c[i], end='')
print()


L1 = input()
L2 = input()
s = input()
p = s.lower()
list = []
for i in range(len(p)):
	if p[i] not in L1:
		list.append(p[i])
	else:
		for j in range(len(L1)):
			if p[i] == L1[j]:
				list.append(L2[j])
l = ''.join(list)
for i in range(len(s)):
	if ord(s[i]) > 64 and ord(s[i]) < 91:
		l = l[:i] + l[i].swapcase() + l[i + 1:]
print(l)


a = input()
b = input()
c = input()
for j in range(len(c)):
	if 65 <= ord(c[j]) <= 90:
		p = a.index(chr(ord(c[j]) + 32))
		print(chr(ord(b[p]) - 32), end='')
	elif 97 <= ord(c[j]) <= 122:
		p = a.index(c[j])
		print(b[p], end='')
	else:
		print(c[j], end='')


def main():
	a = list(input())
	b = list(input())
	string = input()
	string2 = ''
	for x in string:
		if x.lower() in a:
			isupper = x.isupper()
			pos = a.index(x.lower())
			letb = b[pos]
			if isupper:
				string2 = string2 + letb.upper()
			else:
				string2 = string2 + letb
		else:
			string2 = string2 + x
	print(string2)
main()


a = list(input())
b = list(input())
q = input()
d = {}
for i in range(len(a)):
	d[a[i]] = b[i]
for i in q:
	if i.isdigit():
		print(i, end='')
	elif i.isupper():
		print(d[i.lower()].upper(), end='')
	else:
		print(d[i], end='')


s1 = input()
s2 = input()
key = input()
converter = {}
for i in range(len(s1)):
	converter[s1[i]] = s2[i]
	converter[s1[i].upper()] = s2[i].upper()
result = ''
for letter in key:
	if letter in converter:
		result += converter[letter]
	else:
		result += letter
print(result)


a = input()
b = input()
c = input()
layout_dict = dict()
answer = ''
for (i, e) in enumerate(a):
	layout_dict[e] = b[i]
	layout_dict[e.upper()] = b[i].upper()
for e in c:
	output = layout_dict.get(e)
	if output:
		answer += output
	else:
		answer += e
print(answer)


a = list(input())
b = list(input())
c = list(input())
k = {}
for i in range(26):
	k[a[i]] = b[i]
	k[a[i].upper()] = b[i].upper()
for i in range(len(c)):
	if c[i].isalpha():
		c[i] = k[c[i]]
print(*c, sep='')


read = lambda : map(int, input().split())
a = input()
b = input()
low = lambda c: chr(ord(c) + ord('a') - ord('A'))
hig = lambda c: chr(ord(c) - ord('a') + ord('A'))
ish = lambda c: ord('A') <= ord(c) <= ord('Z')
f = lambda c: b[a.index(c)]
s = input()
ans = [''] * len(s)
for i in range(len(s)):
	c = s[i]
	if ord('0') <= ord(c) <= ord('9'):
		ans[i] = c
		continue
	if ish(c):
		ans[i] = hig(f(low(c)))
	else:
		ans[i] = f(c)
print(''.join(ans))


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
s = input().strip()
d = input().strip()
r = input().strip()
f = {}
for i in range(26):
	f[s[i]] = d[i]
	f[s[i].upper()] = d[i].upper()
ans = ''
for i in range(len(r)):
	if r[i].isalpha():
		ans += f[r[i]]
	else:
		ans += r[i]
print(ans)


r1 = list(input())
r2 = list(input())
s = list(input())
dic = {}
for i in range(26):
	dic[r1[i]] = r2[i]
ans = ''
for i in s:
	x = i.lower()
	try:
		y = dic[x]
		if x.upper() == i:
			ans += y.upper()
		else:
			ans += y
	except:
		ans += x
print(ans)


d = {}
s = ''
layout1 = input()
layout2 = input()
text = input()
for i in range(len(layout1)):
	d[layout1[i]] = layout2[i]
for i in text:
	if i.isupper():
		s = s + d.get(i.lower()).upper()
	else:
		s = s + d.get(i, i)
print(s)


s_num1 = input()
s_num2 = input()
s = input()
l_num1 = list(s_num1)
l_num2 = list(s_num2)
l = list(s)
s_swap1 = s_num1.swapcase()
s_swap2 = s_num2.swapcase()
l_high1 = list(s_swap1)
l_high2 = list(s_swap2)
for i in range(len(l)):
	for j in range(len(l_num1)):
		if l[i] == l_num1[j]:
			l[i] = l_num2[j]
			break
		elif l[i] == l_high1[j]:
			l[i] = l_high2[j]
			break
s_final = ''
for i in l:
	s_final += i
print(s_final)


import string
(a, b, string) = (input(), input(), input())
l = len(string)
temp = string.lower().translate(string.maketrans(a, b))
for x in range(l):
	c = string[x]
	if c.lower() != c:
		temp = temp[:x] + temp[x].upper() + temp[x + 1:]
print(temp)


a = input()
b = input()
c = input()
d = []
i = 0
while i < len(c):
	if c[i].isupper():
		e = c[i].lower()
	else:
		e = c[i]
	t = a.find(e)
	if t != -1:
		if c[i].isupper():
			d.append(b[t].upper())
		else:
			d.append(b[t])
	else:
		d.append(e)
	i += 1
print(*d, sep='')


firstLine = input()
secondLine = input()
thirdLine = input()
resultLine = []
for i in range(len(thirdLine)):
	if firstLine.find(thirdLine[i].lower()) >= 0:
		if thirdLine[i] == thirdLine[i].upper():
			resultLine.append(secondLine[firstLine.find(thirdLine[i].lower())].upper())
		else:
			resultLine.append(secondLine[firstLine.find(thirdLine[i])])
	else:
		resultLine.append(thirdLine[i])
print(''.join(resultLine))


r1 = input().strip().lower()
r2 = input().strip().lower()
r1 = r1 + r1.upper() + '0123456789'
r2 = r2 + r2.upper() + '0123456789'
t = input().strip()
print(''.join([r2[r1.index(item)] for item in t]))


a = input()
b = input()
c = input()
ans = ''
for i in range(len(c)):
	if c[i] in a:
		ans += b[a.find(c[i])]
	elif chr(ord(c[i]) + 32) in a:
		ans += chr(ord(b[a.find(chr(ord(c[i]) + 32))]) - 32)
	else:
		ans += c[i]
print(ans)


s = str(input())
t = str(input())
x = str(input())
ans = ''
for c in x:
	if ord(c) <= 90 and ord(c) >= 65:
		a = chr(ord(c) + 32)
		j = s.index(a)
		ans += chr(ord(t[j]) - 32)
	elif ord(c) >= 97 and ord(c) <= 122:
		j = s.index(c)
		ans += t[j]
	else:
		ans += c
print(ans)


s = input()
s2 = input()
text = input()
for i in text:
	if i.lower() in s:
		if i.isupper():
			print(s2[s.index(i.lower())].capitalize(), end='')
		else:
			print(s2[s.index(i.lower())], end='')
	else:
		print(i, end='')


alf1 = input()
alf2 = input()
st = input()
rez = ''
for i in range(len(st)):
	if st[i] >= 'A' and st[i] <= 'Z':
		buf = chr(ord(st[i]) + 32)
		rez += chr(ord(alf2[alf1.index(buf)]) - 32)
	elif st[i] >= 'a' and st[i] <= 'z':
		buf = st[i]
		rez += alf2[alf1.index(buf)]
	else:
		rez += st[i]
print(rez)


ch1 = input()
ch2 = input()
ch3 = input()
d = {}
for i in range(26):
	d[ch1[i]] = ch2[i]
	d[ch1[i].upper()] = ch2[i].upper()
s = ''
for j in ch3:
	if j in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
		s = s + j
	else:
		s += d[j]
print(s)


l1 = input()
l2 = input()
s = input()
r = []
for i in s:
	t = i.lower()
	if t in l1:
		q = l1.find(t)
		if ord(i) < 97:
			r.append(chr(ord(l2[q]) - 32))
		else:
			r.append(l2[q])
	else:
		r.append(i)
print(''.join(r))


d = {}
s = input()
s2 = input()
for (i, c) in enumerate(s):
	d[c] = s2[i]
w = input()
for c in w:
	if c.lower() in d:
		print(d[c.lower()].lower() if c != c.upper() else d[c.lower()].upper(), end='')
	else:
		print(c, end='')


from collections import defaultdict

def solve(a, b, t):
	d = defaultdict()
	s = ''
	for i in t:
		if i in '0123456789':
			s += i
		else:
			x = a.index(i.lower())
			s += b[x].upper() if i.isupper() else b[x]
	return s

def main():
	a = input()
	b = input()
	t = input()
	print(solve(a, b, t))
main()


A = dict()
a = input()
b = input()
c = input()
for i in range(len(a)):
	A[a[i]] = b[i]
a = a.upper()
b = b.upper()
for i in range(len(a)):
	A[a[i]] = b[i]
for i in range(len(c)):
	if c[i].isdigit():
		print(c[i], end='')
	else:
		print(A[c[i]], end='')


def solve(first_keyboard, second_keyboard, text):
	first_keyboard_dict = {}
	for i in range(len(first_keyboard)):
		first_keyboard_dict[first_keyboard[i]] = i
	result = ''
	for char in text:
		is_upper = False
		if char.isupper():
			is_upper = True
			char = char.lower()
		if char in first_keyboard_dict:
			second_char = second_keyboard[first_keyboard_dict[char]]
			if is_upper:
				second_char = second_char.upper()
			result += second_char
		else:
			result += char
	return result
first_keyboard = input()
second_keyboard = input()
text = input()
result = solve(first_keyboard, second_keyboard, text)
print(result)


s1 = input().strip()
s2 = input().strip()
d = {}
for i in range(len(s1)):
	d[s1[i]] = s2[i]
line = input().strip()
res = ''
for ch in line:
	if ch.lower() in d:
		res = res + (d[ch.lower()] if ch.islower() else d[ch.lower()].upper())
	else:
		res = res + ch
print(res)


def decode(key1, key2, msg):
	c_out = ''
	alfie = 'abcdefghijklmnopqrstuvwxyz'
	ALFIE = alfie.upper()
	for x in msg:
		if x in alfie:
			c_out += key2[key1.index(x)]
		elif x in ALFIE:
			c_out += key2[key1.index(x.lower())].upper()
		else:
			c_out += x
	return c_out

def answer():
	key1 = input()
	key2 = input()
	msg = input()
	print(decode(key1, key2, msg))
answer()


a = input()
b = input()
c = input()
final = []
for k in c:
	if k.isdigit():
		final.append(k)
	else:
		if k.isupper():
			upper = True
		else:
			upper = False
		l = k.lower()
		a_i = a.index(l)
		f = b[a_i]
		if upper:
			final.append(f.upper())
		else:
			final.append(f)
st = ''
for l in final:
	st = st + l
print(st)


first = input()
second = input()
text = input()
d = dict()
for i in range(26):
	d[first[i]] = second[i]
for i in text:
	if i.isdigit():
		re = i
	else:
		big = 0
		if i.isupper():
			big = 1
			i = i.lower()
		re = d[i] * 1
		if big:
			re = re.upper()
	print(re, end='')


key1 = list(input())
key2 = list(input())
ip_key1 = list(input())
for i in ip_key1:
	if i.isnumeric():
		print(i, end='')
	elif i.isupper():
		print(key2[key1.index(i.lower())].upper(), end='')
	else:
		print(key2[key1.index(i)], end='')


a = input()
b = input()
c = ''
s = input()
for i in range(len(s)):
	if ord(s[i]) >= 48 and ord(s[i]) <= 57:
		c = c + s[i]
	if ord(s[i]) > 96:
		n = a.index(s[i])
		c = c + b[n]
	elif ord(s[i]) >= 65 and ord(s[i]) <= 90:
		n = a.index(s[i].lower())
		c = c + b[n].upper()
print(c)


first = input()
second = input()
f_template = input()
ans = ''
ref = {}
for (i, _) in enumerate(first):
	ref[first[i]] = second[i]
for c in f_template:
	if ref.get(c, False):
		ans += ref[c]
	elif ref.get(c.lower(), False):
		ans += ref[c.lower()].upper()
	else:
		ans += c
print(ans)


__author__ = 'Dilshod'
a = input()
b = input()
c = input()
ans = ''
for i in c:
	d = a.find(i.lower())
	if d == -1:
		ans += i
		continue
	if i.isupper():
		ans += b[d].upper()
	else:
		ans += b[d]
print(ans)


a = input()
b = input()
c = input()
for i in range(len(c)):
	if c[i].lower() not in a:
		print(c[i], end='', sep='')
	elif c[i].isupper():
		print(b[a.find(c[i].lower())].upper(), sep='', end='')
	else:
		print(b[a.find(c[i])], sep='', end='')


a = input()
b = input()
c = input()
data = dict()
for i in range(26):
	data[a[i]] = b[i]
for i in c:
	if i >= 'a' and i <= 'z':
		print(data[i], end='')
	elif i >= 'A' and i <= 'Z':
		print(data[i.lower()].capitalize(), end='')
	else:
		print(i, end='')


a = input()
b = input()
k = dict(zip(a + a.upper(), b + b.upper()))
[print(k.get(_, _), end='') for _ in input()]


s = input()
s += s.upper()
s0 = input()
s0 += s0.upper()
res = input()
res0 = ''
for i in res:
	if i in s:
		res0 += s0[s.index(i)]
	else:
		res0 += i
print(res0)


(a, b, c) = (input(), input(), input())
d = {}
for char in c:
	for i in range(0, len(a)):
		if a[i] == char.lower():
			d[char.lower()] = i
			break
ans = ''
for char in c:
	if char.isdigit():
		ans += char
	elif char.isupper() == True:
		ans += b[d[char.lower()]].upper()
	else:
		ans += b[d[char]]
print(ans)


import sys

def main():
	a = sys.stdin.readline().rstrip()
	b = sys.stdin.readline().rstrip()
	c = sys.stdin.readline().rstrip()
	x = {}
	for i in range(len(a)):
		x[a[i]] = b[i]
		x[a[i].upper()] = b[i].upper()
	s = [0] * len(c)
	for i in range(len(c)):
		if c[i] in x:
			s[i] = x[c[i]]
		else:
			s[i] = c[i]
	print(''.join(s))
main()


a = input()
b = input()
s = input()
x = ''
for i in s:
	true = False
	for j in range(26):
		if i == a[j]:
			x += b[j]
			true = True
			break
		elif i == chr(ord(a[j]) - 32):
			x += chr(ord(b[j]) - 32)
			true = True
			break
	if not true:
		x += i
print(x)


k1 = input()
k2 = input()
t = input()
d = {}
for i in range(26):
	d[k1[i]] = k2[i]
for i in t:
	try:
		if int(i) or i == '0':
			print(i, end='')
	except:
		if i.isupper():
			i = i.lower()
			print(d[i].upper(), end='')
		else:
			print(d[i], end='')


(a, b, c) = (input(), input(), input())
o = []
for i in c:
	if i.isupper() == True:
		o.append(b[a.find(i.lower())].upper())
	elif i not in a and i not in b:
		o.append(i)
	else:
		o.append(b[a.find(i.lower())])
print(''.join(o))


(a, b, c) = (input(), input(), input())
ans = ''
for i in range(len(c)):
	if c[i].isupper():
		ans += b[a.index(c[i].lower())].upper()
	elif c[i].islower():
		ans += b[a.index(c[i])]
	else:
		ans += c[i]
print(ans)


s1 = input()
s2 = input()
s = input()
ans = ''
for c in s:
	if c.isalpha() and c.isupper():
		tc = c.lower()
		ans += s2[s1.index(tc)].upper()
	elif c.isalpha() and c.islower():
		ans += s2[s1.index(c)]
	else:
		ans += c
print(ans)


key1 = input()
key2 = input()
string = input()
key1 += key1.upper()
key2 += key2.upper()
new_string = ''
for word in string:
	if word in key1:
		new_string += key2[key1.index(word)]
	else:
		new_string += word
print(new_string)


s = str(input())
s1 = str(input())
s2 = str(input())
e = ''
for i in range(0, len(s2)):
	if s2[i].isupper():
		f = s.find(s2[i].lower())
		e = e + s1[f].upper()
	elif s2[i].islower():
		f = s.find(s2[i])
		e = e + s1[f]
	elif s2[i].isdigit():
		e = e + s2[i]
print(e)


s = str(input())
t = str(input())
d = {}
j = 0
for i in t:
	d[str(s[j])] = str(i)
	j = j + 1
u = str(input())
ans = ''
for i in u:
	if i.lower() in d:
		if i.isupper() == True:
			i = i.lower()
			ans = ans + d[i].upper()
		else:
			ans = ans + d[i]
	else:
		ans = ans + i
print(ans)


(a, b) = (input(), input())
dict = {}
d = []
for x in list(input()):
	if x in '0123456789':
		d.append(x)
	elif x == x.lower():
		d.append(b[a.index(x)])
	elif x == x.upper():
		d.append(b[a.index(x.lower())].upper())
print(''.join(d))


keyboard1 = list(input())
keyboard2 = list(input())
s = input()
map = {}
for i in range(26):
	map[keyboard1[i]] = keyboard2[i]
	map[keyboard1[i].upper()] = keyboard2[i].upper()
for i in range(10):
	map[str(i)] = str(i)
for i in range(len(s)):
	print(map[s[i]], end='')
print()


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
a = get_string()
b = get_string()
lst = list(zip(a, b))
c = get_string()
result = ''

def find(lst, x):
	for i in range(len(lst)):
		if lst[i][0] == x:
			return lst[i][1]
for i in c:
	if i.lower() in 'abcdefghijklmnopqrstuvwxyz':
		if i.isupper():
			char = find(lst, i.lower())
			result = result + char.upper()
		else:
			char = find(lst, i)
			result = result + char
	else:
		result += i
print(result)


string1 = input()
string2 = input()
string3 = input()
answer = ''
asnwer_ = ''
for i in range(0, len(string3)):
	temp = 0
	x = string3[i].lower()
	for y in range(0, len(string1)):
		if string1[y] == x:
			if string3[i].isupper():
				answer += string2[y].upper()
				temp = 1
				break
			else:
				answer += string2[y]
				temp = 1
				break
	if temp == 0:
		answer += x
print(answer)


str1 = input()
str2 = input()
s = input()
for i in s:
	if i == i.upper() and i.isalpha():
		x = str1.index(i.lower())
		print(str2[x].upper(), end='')
	elif i == i.lower() and i.isalpha():
		x = str1.index(i)
		print(str2[x], end='')
	else:
		print(i, end='')


s1 = input()
s2 = input()
ws = input()
rs = ''
d = {}
for i in range(26):
	d[s1[i]] = s2[i]
for (key, value) in d.items():
	for i in range(len(ws)):
		if ws[i] in d:
			rs += d[ws[i]]
		elif ord(ws[i]) >= 48 and ord(ws[i]) <= 57:
			rs += ws[i]
		elif chr(ord(ws[i]) + 32) in d:
			x = d[chr(ord(ws[i]) + 32)]
			rs += chr(ord(x) - 32)
	break
print(rs)


import sys
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def minput():
	return map(int, input().split())

def listinput():
	return list(map(int, input().split()))
l1 = list(map(str, input()))
l2 = list(map(str, input()))
answer = ''
tt = input()
for i in tt:
	if i.isnumeric():
		answer += i
	else:
		chars = l1.index(i.lower())
		if i.isupper():
			answer += l2[chars].upper()
		else:
			answer += l2[chars].lower()
print(answer)


voc1 = input()
voc2 = input()
txt = input()
ans = ''
voc1 += '`1234567890-=~!@#$%^&*()_+[]\\{}|,./<>?"\';:'
voc2 += '`1234567890-=~!@#$%^&*()_+[]\\{}|,./<>?"\';:'
for c in txt:
	for j in range(len(voc1)):
		if voc1[j] == c:
			ans += voc2[j]
			break
		elif voc1[j] == c.lower():
			ans += voc2[j].upper()
			break
print(ans)


def text_keys(keyboard1, keyboard2, text):
	new_text = ''
	for i in range(len(text)):
		index = keyboard1.index(text[i].lower())
		if text[i].isupper():
			new_text += keyboard2[index].upper()
		else:
			new_text += keyboard2[index]
	return new_text
keyboard1 = input()
keyboard2 = input()
text = input()
numbers = '0123456789'
keyboard1 += numbers
keyboard2 += numbers
print(text_keys(keyboard1, keyboard2, text))


firstlayout = input()
secondlayout = input()
sentence = input()
modsentence = sentence.lower()
for letter in range(len(modsentence)):
	if modsentence[letter].isdigit():
		print(modsentence[letter], end='')
	elif sentence[letter].isupper():
		print(secondlayout[firstlayout.index(modsentence[letter])].upper(), end='')
	else:
		print(secondlayout[firstlayout.index(modsentence[letter])], end='')


a = input()
b = input()
dic = dict()
for i in range(26):
	dic[a[i]] = b[i]
	dic[chr(ord(a[i]) + 65 - 97)] = chr(ord(b[i]) + 65 - 97)
for i in range(0, 10):
	dic[str(i)] = str(i)
ans = []
r = input()
for y in range(len(r)):
	ans.append(dic[r[y]])
print(''.join(ans))


lay_one = input()
lay_two = input()
string = input()
ans = ''
for letter in string:
	if letter.lower() not in lay_two:
		ans += letter
	elif letter == letter.upper():
		x = lay_one.find(letter.lower())
		ans += lay_two[x].upper()
	else:
		x = lay_one.find(letter)
		ans += lay_two[x]
print(ans)


s1 = input()
s2 = input()
s = input()
temp = ''
t = ''
ind = 0
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		for j in range(len(s1)):
			if s[i] == s1[j]:
				ind = j
				break
		temp = temp + s2[ind]
	elif s[i] >= 'A' and s[i] <= 'Z':
		t = s[i].lower()
		for j in range(len(s1)):
			if t == s1[j]:
				ind = j
				break
		temp = temp + s2[ind].upper()
	else:
		temp = temp + s[i]
print(temp)


a = list(input())
b = list(input())
c = list(input())
ans = ''
entro = False
for (i, elem) in enumerate(c):
	entro = False
	if elem.isdigit():
		ans += elem
		entro = True
		continue
	for (j, eleme) in enumerate(a):
		if eleme == elem.lower():
			if elem.isupper():
				ans += b[j].upper()
			else:
				ans += b[j]
			entro = True
			break
	if not entro:
		break
print(ans if entro else '')


n = input()
m = input()
k = input()
ls = list(zip(n, m))
for i in k:
	flag = 0
	if i.isupper():
		flag = 1
	for (p, q) in ls:
		if p == i.lower():
			print(q.upper(), end='') if flag else print(q, end='')
			break
	else:
		print(i, end='')


first = input()
second = input()
x = input()
y = ''
first += first.upper()
second += second.upper()
for i in range(len(x)):
	if x[i] in first:
		y += second[first.index(x[i])]
	else:
		y += x[i]
print(y)


r1 = list(input())
r2 = list(input())
t = input()
d = {}
for i in range(len(r1)):
	d[r1[i].lower()] = r2[i].lower()
	d[r1[i].upper()] = r2[i].upper()
s = ''
for i in t:
	if i not in d.keys():
		s += i
	else:
		s += d[i]
print(s)


s = input()
s1 = input()
d = {}
for i in range(26):
	d[s[i]] = s1[i]
s2 = input()
r = ''
for i in range(len(s2)):
	if s2[i].isupper() and 65 <= ord(s2[i]) <= 90:
		r += d[s2[i].lower()].upper()
	elif 97 <= ord(s2[i]) <= 122:
		r += d[s2[i]]
	else:
		r += s2[i]
print(r)


first = input()
second = input()
text = input()
for index in range(len(text)):
	letter = text[index]
	if letter.lower() not in first:
		print(letter, end='')
		continue
	if letter == letter.upper():
		l = first.find(letter.lower())
		print(second[l].upper(), end='')
		continue
	l = first.find(letter)
	print(second[l], end='')