#include <iostream>
#include <algorithm>
#include <stack>

using namespace std;

int main()
{
    long long x, y;
    scanf("%lld", &x);
    scanf("%lld", &y);

    long long x1, y1;
    long long a[100];
    int p = 0;
    while(x > 0 && y > 0)
    {
        x1 = x%10;
        y1 = y%10;

        if(x1 > y1)
            a[p] = x1;

        if(x1 < y1)
            a[p] = y1;

        if(x1 == y1)
        {
            a[p] = x1;
            p++;
            a[p] = y1;
        }
        p++;

        x = x/10;
        y = y/10;
    }

    if(x != 0)
        printf("%lld", x);
    if(y != 0)
        printf("%lld", y);

    for(int i = p-1; i >= 0; i--)
    {
        printf("%lld",a[i]);
    }

    return 0;
}