#include <bits/stdc++.h>

using namespace std;

int main()
{
    int64_t x, y, t=1;
    int n;
    cin>>x>>y;
    stack<int> X, Y, E;
    for (n=0; t*10<=x; n++)
        t*=10;
    n++;
    while (n!=0)
    {
        X.push(x/t);
        x-=X.top()*t;
        t/=10;
        n--;
    }
    t=1;
    for (n=0; t*10<=y; n++)
        t*=10;
    n++;
    while (n!=0)
    {
        Y.push(y/t);
        y-=Y.top()*t;
        t/=10;
        n--;
    }
    x=0;y=0;
    while (!X.empty()||!Y.empty())
    {
        if (X.empty())
            x=-1;
        else
        {
            x=X.top();
            X.pop();
        }
        if (Y.empty())
            y=-1;
        else
        {
            y=Y.top();
            Y.pop();
        }
        if (x>y)
            E.push(x);
        else if (x<y)
            E.push(y);
        else
        {
            E.push(x);
            E.push(y);
        }
    }
    while (!E.empty())
    {
        cout<<E.top();
        E.pop();
    }
    return 0;
}