#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    int k=1;
    while(a<=k||b<=k) k*=10;
    int o=0;
    while(k>0){
        int c1=(a/k)%10;
        int c2=(b/k)%10;
        if(c1==c2){
            o*=10;
            o+=c1;
            o*=10;
            o+=c1;
        }else{
            o*=10;
            if(c1>c2)
                o+=c1;
            else
                o+=c2;
        }
        k/=10;
    }
    cout<<o<<endl;
    return 0;
}