#include <iostream>

using namespace std;

int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    long long int s=0;
    while (n>0 || m>0){
        s*=10;
        int n1 = n%10;
        int m1 = m%10;
        n/=10;
        m/=10;
        if (n1 == m1){
            s*=10;
            s+=n1*10+m1;
        }else{
            s+=max(n1,m1);
        }
    }
    while(s>0){
        printf("%d",s%10);
        s/=10;
    }
}