#include <bits/stdc++.h>
using namespace std;
string a, b, res;
int main(){
    cin >> a >> b;
    if(a.size()!=b.size()){
        if(a.size()>b.size()){swap(a, b);}
        for(int i=0; i<=b.size()-a.size()-1; i++){
            res.push_back(b[i]);
        }
        for(int i=0; i<a.size(); i++){
            if(a[i]>b[i+b.size()-a.size()]){
                res.push_back(a[i]);
            }
            if(a[i]<b[i+b.size()-a.size()]){
                res.push_back(b[i+b.size()-a.size()]);
            }
            if(a[i]==b[i+b.size()-a.size()]){
                res.push_back(a[i]);
                res.push_back(a[i]);
            }
        }
    }
    else{
        for(int i=0; i<a.size(); i++){
            if(a[i]>b[i]){
                res.push_back(a[i]);
            }
            if(a[i]<b[i]){
                res.push_back(b[i]);
            }
            if(a[i]==b[i]){
                res.push_back(a[i]);
                res.push_back(a[i]);
            }
        }
    }

    cout << res << endl;
    return 0;
}