#include <iostream>
#include <cmath>
#include <string>

using namespace std;

int main()
{
    string x,y,suma;cin>>x>>y;
    int niz[30];
    int br=0;
    int x1=x.size(),x2=x1;
    int y1=y.size(),y2=y1;

    while (x1>0 || y1>0) {
        if(x1==0){y.erase(y1,y2);suma+=y;break;}
        else if(y1==0){x.erase(x1,x2);suma+=x;break;}
        char c1 = x.at(x1-1);
        int nov1 = (int)c1 - 48;
        char c2 = y.at(y1-1);
        int nov2 = (int)c2 - 48;
        if (nov1 > nov2) 
        {
            niz[br] = nov1;br++;x1--;y1--;
        }
        else if (nov1 < nov2)
        {
            niz[br] = nov2;br++;x1--;y1--;
        }
        else 
        {
            niz[br + 1] = nov1;
            niz[br] = nov1;
            br+=2;x1--;y1--;
        }
    }
    for (int i = br-1; i >= 0; i--) {
        suma+=to_string(niz[i]);
    }
    cout << suma;
    return 0;
}