#include #include #include using namespace std; using ll = long long; int main(){ string s , t; cin >> s >> t; for(int i = 0; i < t.size(); i++){ if('0' <= t[i] && t[i] <= '9'){ t[i] = s[t[i] - '0']; } } cout << t << endl; return 0; }