#include <stdio.h>
main()
{
    int x, y;
    int a = 0;
    int b = 0;
    scanf("%d", &x);
    scanf("%d", &y);
    int xx = x;
    int yy = y;
    while(xx > 0)
    {
        a++;
        xx = xx / 10;
    }
    while(yy > 0)
    {
        b++;
        yy = yy / 10;
    }
    int niz1[a];
    int niz2[b];
    for(int i = 0; i < a; i++)
    {
        niz1[i] = x % 10;
        x = x / 10;
    }
    for(int i = 0; i < b; i++)
    {
        niz2[i] = y % 10;
        y = y / 10;
    }
    if(a > b)
        while(a != b)
        {
            printf("%d", niz1[a - 1]);
            a--;
        }
    else if (b > a)
        while(a != b)
        {
            printf("%d", niz2[b - 1]);
            b--;
        }
    for(int i = b - 1; i >= 0; i--)
        {
            if(niz1[i] > niz2[i])
                printf("%d", niz1[i]);
            else if(niz2[i] > niz1[i])
                printf("%d", niz2[i]);
            else
                printf("%d%d", niz1[i], niz2[i]);
        }
}