#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    unsigned long long x, y;
    cin >> x >> y;
    unsigned long long rez = 0;
    unsigned long long stepen = 1;
    while(x > 0 && y > 0){
        unsigned long long cifra_x = x % 10;
        unsigned long long cifra_y = y % 10;
        x /= 10;
        y /= 10;
        if(cifra_x > cifra_y){
            if(cifra_x != 0){
                cifra_x *= stepen;
                rez += cifra_x;
            }
        }
        else if(cifra_x < cifra_y){
            if(cifra_y != 0){
                cifra_y *= stepen;
                rez += cifra_y;
            }
        }
        else{
            if(cifra_x != 0){
                cifra_x *= stepen;
                rez += cifra_x;
            }
            stepen *= 10;
            if(cifra_y != 0){
                cifra_y *= stepen;
                rez += cifra_y;
            }
        }
        stepen *= 10;
    }
    while(x > 0){
        unsigned long long cifra_x = x % 10;
        x /= 10;
        if(cifra_x != 0){
            cifra_x *= stepen;
            rez += cifra_x;
        }
        stepen *= 10;
    }
    while(y > 0){
        unsigned long long cifra_y = y % 10;
        y /= 10;
        if(cifra_y != 0){
            cifra_y *= stepen;
            rez += cifra_y;
        }
        stepen *= 10;
    }
    cout << rez;
    return 0;
}