#include using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main(){ string a,s,t; cin>>a>>s; rep(i,s.size()){ if(isdigit(s[i])){ t.push_back(a[s[i]-'0']); }else t.push_back(s[i]); } cout<