#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[20];
    int i = 0;

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

        if((cx != cy) || (x == 0 || y == 0))
        {
            cifre[i] = max(cx, cy);
            cerr << "Od cifara " << cx << " i " << cy << " uzimamo " << cifre[i] << endl;
        }
        else
        {
            cifre[i] = cx;
            i++;
            cifre[i] = cx;

            cerr << "Uzimamo cifru " << cx << " 2 puta jer su iste..." << endl;
        }

        x /= 10;
        y /= 10;
        i++;
    }

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

    return 0;
}