```cpp
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main(){
int len,t,i,j;//如果在循环外定义t初值,那么经过一次循环后t初值不再是0,会超过定义的数组长度
string str,substr;
while(cin>>str>>substr){
char max=str[0];
t=0;
len=str.size();
for(i=0;i<len;i++){
if(str[i]>max){
max=str[i];
t=i;
}
}
for(i=0;i<=t;i++) cout<<str[i];
cout<<substr;
for(i=t+1;i<len;i++) cout<<str[i];
cout<<endl;
}
return 0;
}