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

int broj(int a, int b){
    int res = 0;
    for(int i = 1; i < 1000000001 && a!=0 || b!=0;i*=10){
        if(a%10>b%10)
            res=res+(a%10*i);
        else if(a%10==b%10){
            res=res+(a%10*i);
            res=res+(a%10*i*10);
            i= i*10;
        }
        else
            res=res+(b%10*i);
        a/=10;
        b/=10;
    }
    return res;
}

int main()
{
    int a, b;cin>>a>>b;
    cout << broj(a, b);    

    return 0;
}