#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int a, b;
    string c = "";
    cin >> a;
    cin >> b;
    while(a>0 && b>0)
    {
        if(a%10>b%10)
        {
            c = to_string(a%10) + c;
        }
        else if(a%10==b%10)
        {
            c = to_string(a%10) + c;
            c = to_string(a%10) + c;
        }
        else
        {
            c = to_string(b%10) + c;
        }
        a/=10;
        b/=10;
    }
    while(a>0)
    {
        c = to_string(a%10) + c;
        a/=10;
    }
    while(b>0)
    {
        c = to_string(b%10) + c;
        b/=10;
    }
    cout << c << endl;
}