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

int main(){
	long long x, y;
	cin >> x >> y;
	long long tempx = x, tempy = y;
	long long duzinanajmanjeg, duzina1 = 0, duzina2 = 0;
	while(tempx > 0){
		tempx/=10;
		duzina1++;
	}
	while(tempy > 0){
		tempy/=10;
		duzina2++;
	}
	long long zbir = 0;
	long long j = 1;
	long long duzinanajveceg = max(duzina1,duzina2);
	for(long long i = 0; i < duzinanajveceg; i++){
		long long t1,t2;
		if(x > 0) t1 = x%10;
		else t1 = -1;
		if(y > 0) t2 = y%10;
		else t2 = -1;
		if(t1 == t2){
			zbir+=t1*j;
			j*=10;
			zbir+=t2*j;
			j*=10;
			x/=10;
			y/=10;
		}
		else{
			long long veci = max(t1,t2);
			zbir+=veci*j;
			j*=10;
			x/=10;
			y/=10;
		}
	}
	cout<<zbir;
}