#include <iostream>
#include <algorithm>
using namespace std;
int brojcifara(long long n)
{
    if (n == 0)
        return 1;
    int count = 0;
    while (n != 0) {
        n = n / 10;
        ++count;
    }
    return count;
}
int main(){
    //123/100%10 = 1;
    int x,y;
    cin>>x>>y;
    long long int z=0;
    int c=1,b=1;
    int m=max(x,y);
    int mi=min(x,y);
    for(int i=0;i<brojcifara(m);i++){
        if(x/c%10>y/c%10){
            z+=x/c%10*c*b;
       }
        else if(x/c%10==y/c%10){
           z+=x/c%10*c*b;
            b*=10;
           z+=x/c%10*c*b;
       }
        else{
            z+=y/c%10*c*b;
        }
       c*=10;
    }
    cout<<z;
}