#include <iostream>

using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;
    int brx = 0;
    int bry = 0;
    int k = x;
    while(k > 1)
    {
        k = k/10;
        brx++;
    }
    k = y;
    int br;
    while(k > 1)
    {
        k = k/10;
        bry++;
    }
    if(brx>bry)
    {
    	br = brx;
	}
	else
	{
		br = bry;
	}
    int br1=1;
    int r = 0;
    while(br>0)
    {
        if(x%10>y%10)
        {
            r += x%10*br1;
        }
        else if(y%10>x%10)
        {
            r += y%10*br1;
        }
        else
        {
            r += x%10*br1;
            br1 *= 10;
            r += y%10*br1;
        }
        x /= 10;
        y /= 10;
        br1 *= 10;
        br--;
    }
    cout << r;
}