#include<iostream>

using namespace std;

unsigned obrni(unsigned x)
{
    unsigned n=0;
    while(x>0)
    {
        n=n*10+x%10;
        x/=10;
    }
    return n;
}
unsigned maks(unsigned x, unsigned y)
{
    if(x>y)return x;
    else return y;
}
unsigned sudari(unsigned x, unsigned y)
{
    unsigned m=0;
    while(x>0||y>0)
    {
        if(x==0) m=m*10+y%10;
        else if(y==0) m=m*10+x%10;
        else if(x%10==y%10) m=m*100+((x%10)*10+x%10);
      else m=m*10+maks(x%10,y%10);
    x/=10;
    y/=10;
    }
    return m;
}
int main()
{
   unsigned x,y;
    cin>>x>>y;
   
    unsigned m = sudari(x,y);
    unsigned n = obrni(m);
    cout<<n;
    return 0;
}