#include<iostream>
using namespace std;
/*
string.insert方法,支持在指定位置之前插入字符串
*/
int main()
{
string a, b;
while(cin >> a >> b)
{
int pos = 0;
for(int i = 0; i < a.length(); i ++ )
if(a[i] > a[pos])
pos = i;
a.insert(pos + 1, b);
cout << a << endl;
}
return 0;
}