#include <iostream>
#include <cmath> 

using namespace std;


int main()
{
    long long int x,y;
    int brX = 0, brY = 0;
    int i = 0;
    cin >> x;
    cin >> y;
    
    string result;
    long long int current = 0;
    int mx;
    // Nadji broj decimala u x i y
    long long int c = x;
    while (c > 0)
    {
        c /= 10;
        brX++;
    }
    c = y;
    while (c > 0)
    {
        c /= 10;
        brY++;
    }
    
    int xL[brX];
    int yL[brY];
    
    // pronadji individualne cifre za x i y
    for (i = 0; i < brX; i++){
        xL[(brX - 1) - i] = (x / pow(10, brX - (i + 1))) - current / pow(10, brX - (i + 1));
        current += xL[(brX - 1) - i] * pow(10, brX - (i + 1));
    }
    current = 0;
    for (i = 0; i < brY; i++){
        yL[(brY - 1) - i] = (y / pow(10, brY - (i + 1))) - current / pow(10, brY - (i + 1));
        current += yL[(brY - 1) - i] * pow(10, brY - (i + 1));
    }
    
    if (x > y || x == y)
    {
        mx = brX;
    }
    else
    {
       mx = brY;
    }
    
    for (i = mx - 1; i >= 0; i--)
    {
        if ((i + 1) <= brX && (i + 1) <= brY)
        {
            if (yL[i] == xL[i]){
                result += to_string(yL[i]);
                result += to_string(xL[i]);
            }
            else if(xL[i] > yL[i]){
                result += to_string(xL[i]);
            }
            else{
                result += to_string(yL[i]);
            }
        }
        else if ((i + 1) <= brX)
        {
            result += to_string(xL[i]);
        }
        else
        {
            result += to_string(yL[i]);
        }
    }
    cout << result;



    return 0;
}