#include<bits/stdc++.h>

using namespace std;
string s, p;
long long x, y, res1, res2;
stack<long long>a;
int main(){
    cin >> x >> y;
   if(x>=y){
        for(int i = 10; i<=10000000000;i*10){
                if(x!=0){
        res1=x%i;
        res2=y%i;
        //cout << res1 << " " << res2 << endl;
        if(res1>res2){
            a.push(res1);
            //cout << res1 << endl;
        }else if(res2>res1){
            a.push(res2);
            //cout << res2 << endl;
        }else if(res1==res2){
            if(res1+res2==0){
                a.push(res1);
            }else
            if(res1+res2!=0){
               a.push(res1);
            a.push(res2);
            }
           // cout << res1 <<  "" << res2 << endl;
        }
        x=x/i;
        y=y/i;

                }else
                if(x==0){

                     while (!a.empty()) {
                    cout << a.top();
                    a.pop();

                    }
                }
        }
   }
   if(y>x){
        for(int i = 10; i<=1000000000000;i*10){
                if(y!=0){
        res1=x%i;
        res2=y%i;
        //cout << res1 << " " << res2 << endl;
        if(res1>res2){
            a.push(res1);
            //cout << res1 << endl;
        }else if(res2>res1){
            a.push(res2);
            //cout << res2 << endl;
        }else if(res1==res2){
            if(res1+res2==0){
                a.push(res1);
            }else
            if(res1+res2!=0){
               a.push(res1);
               a.push(res2);
            }
           // cout << res1 <<  "" << res2 << endl;
        }
        x=x/i;
        y=y/i;

                }else
                if(y==0){

                     while (!a.empty()) {
                    cout << a.top();
                    a.pop();
                    break;
                    }
                }
        }
   }

cout << endl;

return 0;
}