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