#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <iomanip> 
#include <map>
#include <string>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <deque>

#define f(n) for (long long i = 0; i < n; i++)
#define f0(n) for (int j = 0; j < n; j++)
#define co(n) cout << n << "\n";

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    long long x, y;
    cin >> x >> y;
    if (y > x) swap(x, y);
    long long n;
    n = (long long)(log10(x) + 1);
    long long r = 0;
    long long s = 1;
    f(n)
    {
        long long a = x % 10, b = y % 10;
        if (a > b || y == 0) r += a * s;
        else if (a < b) r += b * s;
        else
        {
            r += a * s;
            s *= 10;
            r += b * s;
        }
        s *= 10;
        x /= 10;
        y /= 10;
    }
    co(r);
}