#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> A >> S; for(char &c : S){ if(c < '0' || '9' < c) cout << c; else cout << A[int(c - '0')]; } cout << endl; return 0; }