#include <iostream>
#include <string>

using namespace std;

int main()
{
    int x, y, i, x1, y1, i1;
    cin >> x >> y;
    int bcx = 0;
    int bcy = 0;
    int hx = x;
    int hy = y;
    while(hx != 0)
    {
        hx = hx / 10;
        bcx++;
    }
    while(hy != 0)
    {
        hy = hy / 10;
        bcy++;
    }
    string a, b;
    string tb = "";
    i = 1;
    i1 = 1;
    while(bcx >= i || bcy >= i)
    {
        x1 = x % 10;
        x = x / 10;
        y1 = y % 10;
        y = y / 10;
        a = to_string(x1);
        b = to_string(y1);
        if(x1 > y1)
        {
            tb = a + tb;
        }
        else if(y1 > x1)
        {
            tb = b + tb;
        }
        else if(x1 == y1 && bcx >= i && bcy >= i)
        {
            tb = a + b + tb;
        }
        else
        {
            tb = a + tb;
        }
        i++;
        i1++;
    }
    cout << tb;
}