#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
// 100 ms ogranicenje a voli while da glumi ludilo vljd ce proci O(n)
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n1, n2, c1, c2;
    ll ans=0;
    int k=1;
    cin >> n1 >> n2;
    while(n1>0 && n2 >0)
    {
        c1 = n1%10;
        c2 = n2%10;
        if(c1>c2)
        {
            ans += c1*k;
        }
        else if(c2>c1)
        {
            ans += c2*k;
        }
        else if(c1 == c2)
        {
            ans += c1*k;
            k*=10;
            ans += c2*k;
        }

        n1/=10;
        n2/=10;
        k*=10;
    }
    while(n1>0)
    {
        ans += (n1%10)*k;
        k*=10;
        n1/=10;
    }
    while(n2>0)
    {
        ans += (n2%10)*k;
        k*=10;
        n2/=10;
    }
    cout << ans;

}