a = input()
s = input()

for (i, c) in enumerate(a):
    s = s.replace(str(i), c)

print(s)