#include <bits/stdc++.h>
using namespace std;

#define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define inf INT_MAX
#define llinf LLONG_MAX
#define mt make_tuple
#define mp make_pair
#define parll pair<ll,ll>
#define parii pair<int,int>
#define frs first
#define sec second
#define neparno(x) (x&1)
#define parno(x) (!neparno(x))
#define lowbit(x) (x&-x)
#define nzd __gcd
#define nzs(e1,e2) (e1/nzd(e1,e2))*e2
#define all(V) V.begin(),V.end()
#define fill(V,v) fill(all(V),v)
#define l_b(BRL,brl) lower_bound( BRL.begin(), BRL.end(), brl )-BRL.begin()-1
#define u_b(BRU,bru) upper_bound( BRU.begin(), BRU.end(), bru )-BRU.begin()
#define mxn 400004

ll a,b,n,m;

ll broj_cifara( ll x )
{
    ll br = 0;
    while ( x > 0 )
    {
        x /= 10;
        br++;
    }
    return br;
}

int main()
{
    ios;

    cin >> a >> b;
    n = broj_cifara(a);
    m = broj_cifara(b);
    if ( n < m )
    {
        swap(a,b);
        swap(n,m);
    }

    string s;
    while ( a > 0 )
    {
        ll ca = a%10;
        ll cb = b%10;
        if ( ca == cb && b > 0 )
        {
            s += (ca+'0');
            s += (cb+'0');
        }
        else
        {
            s += (char)(max(ca,cb)+'0');
        }
        a /= 10;
        b /= 10;
    }
    reverse(all(s));

    cout << s;

    return 0;
}