#include <iostream>

using namespace std;

int a, b, mx, l, x;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>a>>b;

    int dec=1, mx=max(a,b);
    while(mx>0)
    {
        l++;
        mx/=10;
    }

    while(l>0)
    {
        if(min(a,b)==0)
        {
            x+=max(a,b)*dec;
            break;
        }

        if(a%10==b%10)
        {
           x+=dec*(a%10);
           dec*=10;
        }

        x+=dec*max((a%10), (b%10));

        dec=dec*10;
        a/=10;
        b/=10;
        l--;
    }

    cout<<x<<'\n';

    return 0;
}