A = input() S = input() for i, c in enumarate(S): if c is int: S[i] = A[c] print(S)