#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long i = 0, j;
    long long x, y;
    string rez = "";
    string stx, sty;
    cin >> x >> y;
    stx = to_string(x);
    sty = to_string(y);
    if(stx.length() > sty.length())
    {
        j=stx.length()-1;
        for(i=sty.length()-1; i>=0; i--)
        {
            if(stx[j] == sty[i])
            {
                rez += stx[j];
                rez += sty[i];
            }
            else if(stx[j]>sty[i])
                rez += stx[j];
            else
                rez += sty[i];
            j--;
        }
        if(j>=0)
        {
            for(i=j; i>=0; i--)
                rez += stx[i];
        }
    }
    else
    {
        j=sty.length()-1;
        for(i=stx.length()-1; i>=0; i--)
        {
            if(stx[i] == sty[j])
            {
                rez += stx[i];
                rez += sty[j];
            }
            else if(stx[i]>sty[j])
                rez += stx[i];
            else
                rez += sty[j];
                j--;
        }
        if(j>=0)
        {
            for(i=j; i>=0; i--)
                rez += sty[i];
        }
    }
    for(i=rez.length()-1; i>=0; i--)
        cout << rez[i];
    return 0;
}