#include <iostream>
#include <unordered_map>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>
#include <string>

int main() {
    std::string res = "";
    int n1, n2;
    std::cin >> n1 >> n2;
    int o1 = (int)log10(n1)+1, o2 = (int)log10(n2) + 1;
    if (o1 <= o2) {
        while (n1 != 0) {
            int p1 = n1 % 10;
            int p2 = n2 % 10;
            if (p1 < p2) {
                res = std::to_string(p2) + res;
            }
            else if (p1 > p2) {
                res = std::to_string(p1) + res;
            }
            else {
                res = std::to_string(p1) + std::to_string(p1) + res;
            }
            n1 /= 10;
            n2 /= 10;
        }
        if (n2 != 0) {
            res = std::to_string(n2) + res;
        }
    }
    else {
        while (n2 != 0) {
            int p1 = n1 % 10;
            int p2 = n2 % 10;
            if (p1 < p2) {
                res = std::to_string(p2) + res;
            }
            else if (p1 > p2) {
                res = std::to_string(p1) + res;
            }
            else {
                res = std::to_string(p1) + std::to_string(p1) + res;
            }
            n1 /= 10;
            n2 /= 10;
        }
        if (n1 != 0) {
            res = std::to_string(n1) + res;
        }
    }
    std::cout << res << std::endl;
}