#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define ld double
#define ll long long
#define llinf 100000000000000000LL // 10^17
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define sz(a) (ll)(a.size())
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}

#define daj_mi_malo_vremena ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);

using namespace std;
ll x,y;
int main(){
	daj_mi_malo_vremena;
	cin >> x >> y;
	ll ans = 0;
	ll e = 1;
	while(x&&y){
        ll x1 = x%10,y1 = y%10;
        if(x1==y1){
            ans+=e*x1;
            e*=10;
            ans+=e*x1;
        }else ans+=e*max(x1,y1);
        x/=10; y/=10;
        e*=10;
	}
	x = max(x,y);
    while(x){
        ll x1 = x%10;
        ans+=e*x1;
        x/=10;
        e*=10;
    }
    cout<<ans<<endl;
	return 0;
}