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