#include <bits/stdc++.h>
using namespace std;
string x,y,res,a;
int main(){
 cin>>x>>y;
 res="";
 if(y.size()>x.size()){
  swap(x,y);
 }
 /*cout<<x<<endl;
 cout<<y<<endl;*/
 for(int j=0; j<x.size()-y.size(); j++){
   a+='0';
 }
 a+=y;
 //cout<<x<<" "<<a<<endl;
 for(int i=0; i<x.size(); i++){
  if(x[i]>a[i]){
   res+=x[i];
   /*cout<<"Res1 "<<res<<endl;
   cout<<x[i]<<" "<<a[i]<<endl;*/
  }
  else if(x[i]==a[i]){
   if(x[i]!='0'){
    res+=x[i];
    res+=a[i];
    /*cout<<"Res2 "<<res<<endl;
    cout<<x[i]<<" "<<a[i]<<endl;*/
   }
   else{
    res+=x[i];
    /*cout<<"Res3 "<<res<<endl;
    cout<<x[i]<<" "<<a[i]<<endl;*/
   }
  }
  else{
   res+=a[i];
   /*cout<<"Res4 "<<res<<endl;
   cout<<x[i]<<" "<<a[i]<<endl;*/
  }
 }
 cout<<res<<endl;
 //cout<<x<<" "<<a<<endl;
 return 0;
}