#include <iostream>
#include <math.h>
using namespace std;

int main()
{
    int x, y, z, a, b, s;
    double n, d;
    cin>>x>>y;
    if(x<=y)
    {
        z=x;
        x=y;
        y=z;
    }

    z=0;
    s=1;

    while(x>0)
    {
        a=x%10;
        b=y%10;

        if (a == b) {
            z = z + a*s;
            s = s*10;
            z = z + b*s;
            s=s*10;
        } else {
            z = z + max(a,b)*s;
            s=s*10;
        }
        x=x/10;
        y=y/10;
    }
    cout<<z;
    return 0;
}