#include <bits/stdc++.h>
using namespace std;

string a,b,c;
int g;

int main(){

   cin >> a >> b;
   if(a.size()==b.size()){
      for(int i=0;i<a.size();i++){
         if(a[i]>b[i]) cout << a[i];
         if(a[i]<b[i]) cout << b[i];
         if(a[i]==b[i]) cout << a[i] << b[i];
      }
   }
   else if(a.size()>b.size()){
      g=a.size()-b.size();
      for(int i=b.size();i>=0;i--){
         if(a[i+g]>b[i]) c.push_back(a[i+g]);
         if(a[i+g]<b[i]) c.push_back(b[i]);
         if(a[i+g]==b[i]){
            c.push_back(a[i+g]);
            c.push_back(b[i]);
         }
      }
      for(int i=g-1;i>=0;i--){
         c.push_back(a[i]);
      }
      reverse(c.begin(), c.end());
      cout << c << endl;
   }
   else if(b.size()>a.size()){
      string d=b;
      b=a;
      a=d;
      g=a.size()-b.size();
      for(int i=b.size();i>=0;i--){
         if(a[i+g]>b[i]) c.push_back(a[i+g]);
         if(a[i+g]<b[i]) c.push_back(b[i]);
         if(a[i+g]==b[i]){
            c.push_back(a[i+g]);
            c.push_back(b[i]);
         }
      }
      for(int i=g-1;i>=0;i--){
         c.push_back(a[i]);
      }
      reverse(c.begin(), c.end());
      cout << c << endl;
   }
   cout << endl;

return 0;
}