#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long c,d;
    cin>>c>>d;
    int cifra;
    vector <int> a;
    vector <int> b;
    while (c!=0)
    {
        cifra=c%10;
        a.push_back(cifra);
        c=c/10;
    }
    long long d1=a.size();
    while (d!=0)
    {
        cifra=d%10;
        b.push_back(cifra);
        d=d/10;
    }
    long long d2=b.size();
    vector <int> rez;
    if (d1==d2)
    {
        for (long long i=0;i<d1;i++)
        {
            if(a[i]>b[i])
            {
                rez.push_back(a[i]);
            }
            else if (b[i]>a[i])
            {
                rez.push_back(b[i]);
            }
            else if (a[i]==b[i])
            {
                rez.push_back(a[i]);
                rez.push_back(b[i]);
            }
        }
    }
    else if (d1>d2)
    {
        for (long long i=0;i<d2;i++)
        {
            if(a[i]>b[i])
            {
                rez.push_back(a[i]);
            }
            else if (b[i]>a[i])
            {
                rez.push_back(b[i]);
            }
            else if (a[i]==b[i])
            {
                rez.push_back(a[i]);
                rez.push_back(b[i]);
            }
        }
        for (long long i=d2;i<d1;i++)
        {
            rez.push_back(a[i]);
        }
    }
    else if (d2>d1)
    {
        for (long long i=0;i<d1;i++)
        {
            if(a[i]>b[i])
            {
                rez.push_back(a[i]);
            }
            else if (b[i]>a[i])
            {
                rez.push_back(b[i]);
            }
            else if (a[i]==b[i])
            {
                rez.push_back(a[i]);
                rez.push_back(b[i]);
            }
        }
        for (long long i=d1;i<d2;i++)
        {
            rez.push_back(b[i]);
        }
    }
    long long d3=rez.size();
    for (long long i=d3-1;i>=0;i--)
    {
        cout<<rez[i];
    }
    cout<<endl;
}