#include <bits/stdc++.h>

using namespace std;

int cd(long long n)
{
    if (n == 0)
        return 1;
    int count = 0;
    while (n != 0) {
        n = n / 10;
        ++count;
    }
    return count;
}

int main()
{
    
    long long x, y, a, b, res=0, k = 1, g=1;
    cin >> x >> y;
    int m = max(cd(x), cd(y));
    for (int i = 0; i < m; i++)
    {
        a = x/k%10;
        b = y/k%10;
        if(a != b || a == 0 && b == 0)
        {
            res += max(a, b)*k*g;
            
        }
        else
        {
            res += (a*k + b*k*10)*g;
            g*=10;
        }
        k*=10;
    }
    cout << res;

    return 0;
}