#include<bits/stdc++.h>

using namespace std;

int main(int argc, char **argv){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    string X, Y, N;
    int r = 0;

    cin >> X >> Y;

    if(X.length() == Y.length()){
        for(int i = 0; i < X.length(); i++){
            if(X[i] > Y[i]) N += X[i];
            else if(X[i] < Y[i]) N += Y[i];
            else{
                N += X[i];
                N += Y[i];
            }
        }
    }

    else if(X.length() < Y.length()){
        r = Y.length() - X.length();
        for(int i = 0; i < r; i++){
            N += Y[i];
        }

        for(int i = 0; i < X.length(); i++){
            if(X[i] > Y[i+r]) N += X[i];
            else if(X[i] < Y[i+r]) N += Y[i+r];
            else{
                N += X[i];
                N += Y[i+r];
            }        
        }
    }

    else if(X.length() > Y.length()){
        r = X.length() - Y.length();
        for(int i = 0; i < r; i++) {
            N += X[i];
        }
        cout << N << '\n';
        for(int i = 0; i < Y.length(); i++){
            if(X[i+r] > Y[i]) N += X[i+r];
            else if(X[i+r] < Y[i]) N += Y[i];
            else{
                N += X[i+r];
                N += Y[i];
            }
        }
    }
    cout << N;
}