#include <iostream>
using namespace std;

int main()
{
    long long a, b, g = 0, h = 1;
    cin >> a >> b;
    while(a > 0 || b > 0){
        int x = a % 10;
        if(a == 0)
            x = -1;
        int y = b % 10;
        if(b == 0)
            y = -1;
        if(x < y)
            g += y * h;
        else if(y < x)
            g += x * h;
        else{
            g += x * h;
            h *= 10;
            g += x * h;}
        h *= 10;
        a /= 10;
        b /= 10; }
    cout << g;
    return 0;
}