#include<bits/stdc++.h>

using namespace std;
long long x, y, res1, res2;
stack<long long>a;
int main(){
    scanf("%d",&x);
    scanf("%d",&y);
   if(x>=y){
        for(int i = 10; i<=10000000000;i*10){
                if(x!=0){
        res1=x%i;
        res2=y%i;

        if(res1>res2){
            a.push(res1);

        }else if(res2>res1){
            a.push(res2);

        }else if(res1==res2){
            if(res1+res2==0){
                a.push(res1);
            }else
            if(res1+res2!=0){
                a.push(res1);
                a.push(res2);
            }
        }
        x=x/i;
        y=y/i;
                }else
                if(x==0){
                    while (!a.empty()) {
                    cout << a.top();
                    a.pop();
                    }
                    return 0;
                }
        }
   }
   if(y>x){
        for(int i = 10; i<=10000000000;i*10){
                if(y!=0){
        res1=x%i;
        res2=y%i;
        if(res1>res2){
            a.push(res1);
        }else if(res2>res1){
            a.push(res2);
        }else if(res1==res2){
            if(res1+res2==0){
            a.push(res1);
            }else
            if(res1+res2!=0){
            a.push(res1);
            a.push(res2);
            }
        }
        x=x/i;
        y=y/i;
                }else
                if(y==0){
                    while (!a.empty()) {
                    cout << a.top();
                    a.pop();
                    }
                    return 0;
                }
        }

    }


return 0;
}