A = str(input()) S = str(input()) d = {} for i, a in enumerate(A): d[str(i)] = a ans = [] for c in S: if c.isalpha(): ans.append(c) else: ans.append(d[c]) print(''.join(ans))