#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
   long a,b,x,y,m=0,k=1;
cin>>x>>y;
while(x+y!=0){
    a=x%10;
    b=y%10;
    m+=max(a,b)*k;
    if(a==b && x!=0 && y!=0){
        k*=10;
        m+=a*k;
    }
    k*=10;
    y/=10;
    x/=10;
}
cout<<m;
}