#include <bits/stdc++.h>
#define MAXN 100010
#define pb push_back
#define ll long long
#define fi first
#define se second
#define mp make_pair

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	int a, b;
	cin >> a >> b;
	vector<int> v;
	while (a > 0 || b > 0)
    {
        int a1 = a % 10, b1 = b % 10;
        a /= 10; b /= 10;
        if (a1 > b1) v.pb(a1);
        else if (a1 < b1) v.pb(b1);
        else
        {
            if (a1 != 0) v.pb(a1);
            v.pb(b1);
        }
    }
    for (int i = v.size()-1; i >= 0; i--)
        cout << v[i];
	return 0;
}