include[HTML_REMOVED]
using namespace std;
int main()
{
string a,b;
while(cin>>a>>b)
{
int i,max=0;
for(i=1;i<=a.size();i++)
{
if(int(a[i])>a[max])
max=i;
}
cout<<a.substr(0,max+1)<<b<<a.substr(max+1)<<endl;
}
}