#include <iostream>
using namespace std;
int main()
{
string str, substr;
while (cin >> str >> substr)
{
int mark = 0;
for (int i = 0; str[i]; i ++ )
{
if (str[mark] < str[i])
{
mark = i;
}
}
string s;
for (int i = 0; i <= mark; i ++ )
{
s = s + str[i];
}
s += substr;
for (int i = mark + 1; str[i]; i ++ )
{
s = s + str[i];
}
cout << s << endl;
}
return 0;
}