#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    int x, y; cin >> x >> y;
    int cifre[18];
    int i = 0;

    while(x > 0 || y > 0)
    {
        int cx = x % 10;
        int cy = y % 10;

        x /= 10;
        y /= 10;

        if((cx != cy) || (x == 0 || y == 0))
        {
            cifre[i] = max(cx, cy);
        }
        else
        {
            cifre[i] = cx;
            i++;
            cifre[i] = cx;
        }

        i++;
    }

    for(int j = i - 1; j >= 0; j--)
    {
        cout << cifre[j];
    }

    return 0;
}