#include<iostream>
using namespace std;

int main(){
    int br1,br2;
    cin >> br1 >> br2;
    int max;
    if (br1>=br2) {max=br1;}
    else {max=br2;}
    int d=1;
    while (max>=10){
        max=max/10;;
        d=d*10;
    }
    int br=0;
    int c;
    while (d>=1){
        if ((br1/d)>(br2/d)) {c=br1/d;br=br+c*d;}
        else {
            if ((br1/d)<(br2/d)){
                c=br2/d;
                br=br+c*d;
            }
            else {
                c=br1/d;
                br=br*10;
                br=br+11*d;
            }
        }
        
        br1=br1-(br1/d)*d;
        br2=br2-(br2/d)*d;
        d=d/10;
        
    }
    cout << br;
    return 0;
}