#include<bits/stdc++.h>

using namespace std;

vector<int> a, b, c;
int x, y;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin >> x >> y;

    while(x) {
        a.push_back(x%10);
        x/=10;
    }
    while(y) {
        b.push_back(y%10);
        y/=10;
    }
    if(a.size()<b.size()) swap(a, b);

    for(int i=0; i<b.size(); i++) {
        if(a[i]==b[i]) {
            c.push_back(a[i]);
            c.push_back(b[i]);
        }
        else if(a[i]>b[i]) c.push_back(a[i]);
        else c.push_back(b[i]);
    }
    for(int i=b.size(); i<a.size(); i++) c.push_back(a[i]);

    for(int i=c.size()-1; i>=0; i--) cout << c[i];

    return 0;
}