#include <bits/stdc++.h>

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

using namespace std;

int main()
{
    FAST

    long long a, b;
    cin >> a >> b;
    long long c = 0;
    long long k = 1;
    if(a < b) swap(a, b);
    while(a){
        long long jedinicaa = a % 10;
        long long jedinicab = b % 10;
        a /= 10;
        b /= 10;
        if(jedinicaa != jedinicab)
            c += max(jedinicaa, jedinicab) * k;
        else{
            c += jedinicaa * k;
            c += jedinicaa * 10 * k;
            k *= 10;
        }
        k *= 10;
    }
    cout << c << endl;
    return 0;
}