import string
xiao = string.ascii_lowercase
a = []
w = [a.append(i) for i in input() if not i in a]
x = [a.append(i) for i in xiao if not i in a]
n = []
wn = input()
for i in wn:
n.append(a[xiao.find(i)])
print(''.join(n))
xiao = string.ascii_lowercase
a = []
w = [a.append(i) for i in input() if not i in a]
x = [a.append(i) for i in xiao if not i in a]
n = []
wn = input()
for i in wn:
n.append(a[xiao.find(i)])
print(''.join(n))