#include<bits/stdc++.h>

using namespace std;

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

    int x, y, a, b;

    cin >> x >> y;

    string ans = "";
    while(x != 0 && y != 0){
        a = x % 10;
        b = y % 10;
        x = x / 10;
        y = y / 10;

        if(a > b) ans += to_string(a);
        else if(b > a) ans += to_string(b);
        else ans += (to_string(a) + to_string(a));
    }


    int ostatak = max(x, y);
    while(ostatak != 0){
        ans += to_string(ostatak % 10);
        ostatak /= 10;
    }

    for(int i = ans.length(); i >= 0; i--) cout << ans[i];
    return 0;
}