def main(): a = input() s = input() dic = {} others = {} for i in range(len(a)): others = {str(i):a[i]} dic.update(others) #print(dic) s2 = [] for j in s: if j in dic: s2.append(dic[j]) else: s2.append(j) text = "".join(s2) print(text) #Aを辞書(key:アルファベット、value:0からの数字) #for文でsがvalueに含まれる場合、keyと変換 if __name__ == '__main__': main()