#include <bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long x, y;
    cin >> x;
    cin >> y;
    unsigned long pom = 1;
    int x1, y1;
    unsigned long res = 0;
    while ((x > 0) or (y > 0))
    {
        if(x == 0)
        {
            res += y * pom;
            y = 0;
        }
        else if(y == 0)
        {
            res += x * pom;
            x = 0;
        }
        else
        {
            x1 = x % 10;
            y1 = y % 10;
            
            if(x1 > y1)
            {
                res += pom * x1;
                pom *= 10;
            }
            else if(y1 > x1)
            {
                res += pom * y1;
                pom *= 10;
            }
            else
            {
                res += pom * x1;
                pom *= 10;
                res += pom * y1;
                pom *= 10;
            }
            x /= 10;
            y /= 10;
        }
    }
    cout << res;
    return 0;
}