#include <iostream>
#include <math.h>

using namespace std;

unsigned long long cpr(unsigned long long x, unsigned long long y){
    if(x>y){
        return x;
    }
    else if(x<y){
        return y;
    }
    else if(x==y){
        return -1;
    }
}

int main()
{
    unsigned long long x,y,n=0;
    int h=0;
    cin>>x>>y;
    while((x>0)|| (y>0)){
        if(x>0 && y>0){
            if(cpr(x%10,y%10)==-1){
                n+=(x%10)*pow(10,h);
                h++;
                n+=(x%10)*pow(10,h);
            }
            else{
                n+=cpr(x%10,y%10)*pow(10,h);
            }
            x/=10;
            y/=10;
        }
        else if(x==0 && y>0){
            n+=(y%10)*pow(10,h);
            y/=10;
        }
        else if(x>0 && y==0){
            n+=(x%10)*pow(10,h);
            x/=10;
        }
        h++;
    }
    cout<<n;
}