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

int main(){
    int x, y;
	cin >> x >> y;
    int n=0, a, b, i=1;
    while(x>0||y>0){
        a = x%10;
        b = y%10;
        
        if(a==b&&(y!=0&&x!=0)){
            n=n+a*i;
            i=i*10;
            n=n+a*i;
        }
        else{
            n=n+max(a,b)*i;
        }
        i=i*10;
        y = y/10;
        x = x/10;
        
    }
    cout << n;
    return 0;
}