#include<bits/stdc++.h>
using namespace std;
string x,y,z;
int br,q,w,br1;
int main(){
   cin>>x>>y;
   q=x.size();
   w=y.size();
   br=abs(q-w);
   br1=br;
   if(q>w){
    cout<<x.substr(0,br);
   }
   else if(q<w){
    cout<<y.substr(0,br);
   }
   if(q>w){
      for(int i=0;i<q-br1;i++){
         if(x[br]>y[i]){
            cout<<x[br];
         }
         else if(x[br]<y[i]){
            cout<<y[i];
         }
         else{
            cout<<y[i]<<y[i];
         }
         br++;
      }
   }
   else if(q<w){
      for(int i=0;i<w-br1;i++){
         if(x[i]>y[br]){
            cout<<x[i];
         }
         else if(x[i]<y[br]){
            cout<<y[br];
         }
         else{
            cout<<x[i]<<x[i];
         }
         br++;
      }
   }
   else{
      for(int i=0;i<q;i++){
         if(x[br]>y[i]){
            cout<<x[br];
         }
         else if(x[br]<y[i]){
            cout<<y[i];
         }
         else{
            cout<<x[i]<<x[i];
         }
         br++;
      }
   }
return 0;
}