#include <iostream>
using namespace std;
int main() {
long long x, y, t;
 t = 0;
long long s = 1;
cin >> x >> y;
do{if (x%10 < y%10) {
t = t + (y%10)*s;}
else if (x%10 > y%10) {
t = t + (x%10)*s;}
else if (x % 10 == y % 10) {
t = t + (x%10*10 + y%10)*s;
s*=10;}
x = x/10;
y = y/10;
s*=10;}
while(max(x, y)>0);
cout << t;
 return 0;}