#define _USE_MATH_DEFINES
#include<iostream>
#include<sstream> 
#include<cmath>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<conio.h>
#include<numeric>
#include<map>
#include<set>
#include<stack>
#include<stdlib.h>  
#include<unordered_map>
#include <queue>
using namespace std;

#define int long long




int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int a, b;
    cin >> a >> b;
    stack<int>stek1;
    stack<int>stek2;
    while (a > 0) {
        stek1.push(a % 10);
        a = a / 10;
    }
    while (b > 0) {
        stek2.push(b % 10);
        b = b / 10;
    }
    if (stek1.size() < stek2.size()) {
        while (stek1.size() < stek2.size()) stek1.push(-1);
    }
    else if (stek1.size() > stek2.size()) {
        while (stek2.size() < stek1.size()) stek2.push(-1);
    }
    while (!stek1.empty() && !stek2.empty()) {
        if (stek1.top() > stek2.top()) cout << stek1.top();
        else if (stek2.top() > stek1.top()) cout << stek2.top();
        else  if (stek2.top() == stek1.top()) cout << stek1.top() << stek2.top();
        stek1.pop();
        stek2.pop();
    }
    return 0;
}