#include <iostream>
#include <map>

using namespace std;

int a, b, la, lb, l, x;

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

    cin>>a>>b;

    int a1=a, b1=b, dec=1;

    while(a1>0)
    {
        la++;
        a1/=10;
    }
    while(b1>0)
    {
        lb++;
        b1/=10;
    }

    l = max(la, lb);
    while(l>0)
    {
        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;
}