#include <iostream>
#include <deque>

using namespace std;

int main()
{
    long long x,y;
    deque <int> konacno;
    cin>>x>>y;
    while(x!=0||y!=0)
    {
        if(x%10>y%10)
            konacno.push_front(x%10);
        else if(x%10<y%10)
           konacno.push_front(y%10);
        else
        {
            if(x!=0&&y!=0)
            {
                konacno.push_front(x%10);
                konacno.push_front(y%10);
            }
            else
               konacno.push_front(x%10);
        }
        x/=10;
        y/=10;
    }
    for(int i=0; i<konacno.size(); i++)
        cout<<konacno[i];
}