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