#include <iostream>
#include <string>
using namespace std;

int main()
{
    string a, b;
    cin >> a;
    cin >> b;

    int len = a.length() > b.length() ? a.length() : b.length();
   
    string res = "";

    for (int i = 0; i < len; i++)
    {
        int c1, c2;
        if (i > a.length() - 1) c1 = -1;
        else c1 = a[a.length() - i - 1] - 48;
        if (i > b.length() - 1) c2 = -1;
        else c2 = b[b.length() - i - 1] - 48;

        if (c1 > c2) res = to_string(c1) + res;
        else if (c2 > c1) res = to_string(c2) + res;
        else res = to_string(c1) + to_string(c1) + res;
    }
    cout << res;
}