#include <iostream>
#include <vector>

using namespace std;

int main(int argc, const char * argv[]) {
    string stra, strb;
    cin >> stra >> strb;
    if(stra.size() < strb.size()){
        string s = stra;
        stra = strb;
        strb = s;
    }
    vector<int> a(stra.size()), b(strb.size());
    int diff = stra.size() - strb.size();
    for(int i = stra.size(); i >= 0; --i){
        a[i] = stra[i] - '0';
    }
    
    for(int i = stra.size(); i >= diff; --i){
        b[i] = strb[i-diff] - '0';
    }
    
    for(int i = 0; i < diff; ++i){
        b[i] = -1;
    }
    vector<int> res;
    
    for(int i = 0; i < a.size(); ++i){
        if(a[i] == b[i]){
            res.push_back(a[i]);
        }
        if(a[i] > b[i]){
            res.push_back(a[i]);
        }
        else{
            res.push_back(b[i]);
        }
    }
    
    for(int i = 0; i < res.size(); ++i){
        if(res[i] != -1){
            cout << res[i];
        }
    }
    cout << endl;
    
    return 0;
}