#include <bits/stdc++.h>

using namespace std;

int main() {
    long long x, y;
    cin >> x >> y;
    
    long long br = 0;
    long long pomeraj = 1;
    
    while(x > 0 || y > 0) {
        int a = x % 10;
        int b = y % 10;
        
        if(x == 0)
            a = -1;
        
        if(y == 0)
            b = -1;
            
        
        if(a > b)
            br += a * pomeraj;
            
        else if(b > a)
            br += b * pomeraj;
            
        else if(a == b) {
            br += a * pomeraj;
            pomeraj *= 10;
            br += a * pomeraj; }
            
        pomeraj *= 10;
        
        x /= 10;
        y /= 10;
    }
    
    cout << br << endl;
    
    return 0;
}