#include <bits/stdc++.h>

using namespace std;

void optimizeio()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

long long inverz(long long a)
{
    long long b = 0;
    while(a > 0)
    {
        b *= 10;
        b += a % 10;
        a /= 10;
    }

    return b;
}

int main()
{
    optimizeio();
    long long x, y;
    long long z = 0;
    cin >> x >> y;

    while(x > 0 || y > 0)
    {
        long long x1, y1;
        x1 = x % 10;
        y1 = y % 10;

        z *= 10;
        if(x == 0)
        {
            z += y1;
        }
        else if(y == 0)
        {
            z += x1;
        }
        else if(x1 == y1)
        {
            z += x1;
            z *= 10;
            z += y1;
        }
        else
        {
            z += max(x1, y1);
        }

        x /= 10;
        y /= 10;
    }

    int Z = inverz(z);
    cout << Z;
    return 0;
}