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

vector<int> fja(int n){
    vector<int> v;
    while(n>0){
        v.push_back(n%10);
        n/=10;
    }
    return v;
}
int main()
{
    int a,b,c;
    vector<int> n1,n2,n3;
    cin>>a>>b;
    n1=fja(a);
    n2=fja(b);
    int vn1, vn2;
    vn1=n1.size();
    vn2=n2.size();
    int v=min(vn1,vn2);
    for(int i=0;i<v;i++){
        if(n1[i]>n2[i]){
            n3.push_back(n1[i]);
        }
        else if(n2[i]>n1[i]){
            n3.push_back(n2[i]);
        }
        else{
            n3.push_back(n1[i]);
            n3.push_back(n1[i]);
        }
    }
    int v1=max(vn1,vn2);
    n1.resize(v1);
    n2.resize(v1);
    for(int i=v;i<v1;i++){
        if(n1[i]>n2[i]){
            n3.push_back(n1[i]);
        }
        else{
            n3.push_back(n2[i]);
        }
    }    

    reverse(n3.begin(), n3.end());
/*    for(auto i:n1){
        cout<<i<<" ";
    }
    cout<<endl;
    for(auto i:n2){
        cout<<i<<" ";
    }
    cout<<endl;
    */
    for(auto i:n3){
        cout<<i;
    }
    
    return 0;
}