#include <iostream>
using namespace std;

int main(){
    int x,y,z=0,n=1;
    cin>>x>>y;
    while(x>0 || y>0){
        int p=x%10,q=y%10;
        if(p>q) z=p*n+z;
        else if(q>p) z=q*n+z;
        else{
            z=p*n+z;
            if(x!=0 && y!=0){
              n*=10;
              z=q*n+z;
            }
        }
        n*=10;
        x/=10;
        y/=10;
    }
    cout<<z;
}