#include<bits/stdc++.h>
using namespace std;
void dfs(string z,string h)
{
if(z.size() == 0)
return;
char rt = h[h.size()-1];
int pos = z.find(rt);
cout<<rt;
dfs(z.substr(0,pos),h.substr(0,pos));
dfs(z.substr(pos+1),h.substr(pos,h.size()-1));
}
int main(){
string z,h;
cin>>z>>h;
dfs(z,h);
return 0;
}
帮帮本蒟蒻吧!^o^