#include<list>
#include <iostream>
#include<bits\stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    unsigned x,y;
    cin>>x>>y;
    list<int> l1;
    if(x>y){
        while(y>0){
        int m=x%10;
        int n=y%10;
        if(m>n)l1.push_front(m);

        else if(m==n){
                l1.push_front(m);
                l1.push_front(n);
        }
        else l1.push_front(n);
        x/=10;
        y/=10;
        if(y==0 && x!=0){
            l1.push_front(x);
        }
        }

    }
    if(y>x){
        while(x>0){
        int m=x%10;
        int n=y%10;
        if(n>m)l1.push_front(n);
        else if(m==n){
                l1.push_front(m);
                l1.push_front(n);
        }
        else l1.push_front(m);
        x/=10;
        y/=10;
        if(x==0 && y!=0){
            l1.push_front(y);
        }
        }
    }


    for (list<int>::iterator p = l1.begin(); p != l1.end(); p++)
    cout << *p;
    return 0;
}