#include <iostream>
using namespace std;
int main()
{
    long long X, Y;
    cin >> X >> Y;
    if (Y > X) { long long t = X; X = Y; Y = t; }
    long long a, b, xy = 0, res=0;
    while (X > 0)
    {   a = X % 10; b = Y % 10;
        if (Y > 0)
        {
           
            if (a > b) xy = xy * 10 + a;
            else if (a < b) xy = xy * 10 + b;
            else xy = xy * 100 + a * 10 + a;
            
        }
        else xy = xy * 10 + a;
        X /= 10;Y /= 10;
    }
    while (xy > 0)
    {
        res = res * 10 + xy % 10;
        xy /= 10;
    }
    cout << res;

    return 0;
}