#include <bits/stdc++.h>

using namespace std;

#define ll long long
int main()
{
    ll x,y;
    cin>>x;
    cin>>y;
    ll rez,brcif;
    brcif=rez=0;
    while(x>0 || y>0){
        if(x%10 != y%10){
            rez += (max(x%10,y%10))*pow(10,brcif);
            //cout<<max(x%10,y%10)*pow(10,brcif)<<endl;
            x/=10; y/=10;
            brcif++;
            //cout<<rez<<" brcif: "<<brcif-1<<endl;
        }
        else if(x>0 && y>0){
            //cout<<"usao"<<endl;
            rez+=(max(x,y)%10)*pow(10,brcif) + (max(x,y)%10)*pow(10,brcif+1);
            x/=10; y/=10;
            brcif += 2;
            //cout<<rez<<endl;
        }
        else{
            rez+=(max(x,y)%10)*pow(10,brcif);
            x/=10; y/=10;
            brcif ++;
        }
    }
    cout<<rez<<endl;


}