#include <iostream>
#include <string>

using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;
    string s = "";
    while (x > 0 || y > 0)
    {
        string s1;
        if (x % 10 != y % 10)
            s1 = to_string(max(x % 10, y % 10));
        else
        {
            s1 = to_string(x % 10);
            s1 += s1;
        }
        s = s1 + s;
        x /= 10;
        y /= 10;
    }
    cout << s;
}