#include <bits/stdc++.h>
#define ff(i,a,b) for(int (i) = (a); (i) < (b); ++ (i))
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pic pair<int,char>
#define FF(i,a,b) for(int (i) = (a); (i) > (b); -- (i))
#define xx first
#define yy second
#define pb push_back
#define ll long long
#define pqq priority_queue
using namespace std;
void solve(){
	long long x,y;
	cin>>x>>y;
    __int128 res = 10;
	while(x>0 && y>0){
		if(x%10 == y%10){
			res+=x%10;
			res*=10;
			x/=10;
			res+=y%10;
			res*=10;
			y/=10;
		}else if(x%10>y%10){
			res+=x%10;
			res*=10;
			x/=10;
			y/=10;
		}else{
			res+=y%10;
			res*=10;
			x/=10;
			y/=10;
		}
	}
	while(x>0){
		res+=x%10;
		res*=10;
		x/=10;
	}
	while(y>0){
		res+=y%10;
		res*=10;
		y/=10;
	}
	res/=10;
	while(res>=10){
		int a = res%10;
		cout<<a;
		res/=10;
	}
}
int main(){
	ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}