#include #include using namespace std; int main(){ string a,s; cin>>a>>s; for(auto&x:s) if('0'<=x&&x<='9') x=a[x-'0']; cout<