#include <bits/stdc++.h>
using namespace std;
string a, b;
int main () {

    cin >> a >> b;
    if (a.size()>b.size()){                 ///kad je a veci
        for (int i=0; i<a.size(); i++){
            while(b.size()!=a.size()){
                cout << a[i];
                a.erase(0,1);
            }
            if(a[i]>b[i]){
                cout << a[i];
            }
            else if(a[i]<b[i]){
                cout << b[i];
            }
            else if(a[i]==b[i] and b[0]!='0'){cout << a[i] << b[i];}
        }
    }
    else if (a.size()<b.size()){            ///kad je b veci
        for (int i=0; i<b.size(); i++){
            while(a.size()!=b.size()){
                cout << b[i];
                b.erase(0,1);
            }
            if(a[i]>b[i]){
                cout << a[i];
            }
            else if(a[i]<b[i]){
                cout << b[i];
            }
        }
    }
    else if (a.size()==b.size()){           ///kad su jednaki
        for (int i=0; i<b.size(); i++){
            if(a[i]>b[i]){
                cout << a[i];
            }
            else if(a[i]<b[i]){
                cout << b[i];
            }
            else if(a[i]==b[i]){cout << a[i] << b[i];}
        }
    }
    return 0;
}