#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int x,y,a,b,m;
    cin>>x>>y;
    int br=0;
    int n=0;
    
    do {
        a=x%10;
        b=y%10;
        m=max({a,b});
        if (m==a && m==b){
            br=br*10+m;
            br=br*10+m;
            n+=2;
        }
        else {
            br=br*10+m;
            n+=1;
        }
        x=x/10;
        y=y/10;
        
    } while (x>0 || y>0);
    int br2=0;
    
    for (int i=0;i<n;i++){
        br2=br2*10+br%10;
        br=br/10;
    }
    cout<<br2;

    return 0;
}