#include<bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    int x,y;
    cin >> x >> y;
    vector<int> br;
    if(x > y){
        while(x != 0){
            if(x%10 == y%10 && y != 0){
                br.push_back(x%10);
                br.push_back(y%10);
            }
            else{
                br.push_back(max(x%10,y%10));
            }
            x /= 10;
            y /= 10;
        }
    }
    else{
        while(y != 0){
            if(x%10 == y%10 && x != 0){
                 br.push_back(x%10);
                 br.push_back(y%10);
             }
             else{
                 br.push_back(max(x%10,y%10));
             }
             x /= 10;
             y /= 10;


        }
    }
    reverse(br.begin(), br.end());
    for(int i : br) cout << i;
}