#include<iostream>
#include<cmath>

using namespace std;

int main(){
    int x, y;
    cin >> x >> y;
    int n = 0, cx, cy;
    int i = 0;
    while(x > 0 || y > 0){
        cx = x % 10;
        cy = y % 10;
        if(cx > cy) n += cx*pow(10, i);
        else if(cy > cx) n += cy*pow(10, i);
        else if(cx == cy && (x > 0 && y > 0)){
            n += cx*pow(10, i+1) + cx*pow(10, i);
            i++;
        }
        x /= 10;
        y /= 10;
        i++;
    }
    cout << n << "\n";
    return 0;
}