#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string A, S; cin >> A >> S; map mp; for (int i = 0; i < A.size(); i++) mp[i] = A[i]; for (int i = 0; i < S.size(); i++) { int d = S[i] - '0'; if (d >= 0 && d <= 9) { S[i] = mp[d]; } } cout << S << endl; return 0; }