#include <iostream>

using namespace std;

int main()
{
    int a, b, r;
    cin>> a;
    cin>> b;
    int k = max(a,b);
    for (int i = 1; i <= k; i = i * 10)
    {
        int p = (a/i) % 10;
        int q = (b/i) % 10;
        if ( p > q)
        {
            r = r + p * i;
        }
        else if (p < q)
        {
            r = r + q * i;
        }
        else if (p == q)
        {
            r = r + (p * i + q);
        }
    }
    cout<<r;

}