#include<iostream>
#include<iomanip>
using namespace std;
main()
{
     unsigned long long int x, y, z = 0, i = 1, a, b;
     cin >> x;
     cin >> y;
     while(x > 0 || y  > 0){
             a = x % 10;
             b = y % 10;
             if(a > b){
                z += a * i;     
             }
             else if(a < b){
                z += b * i;    
             }
             else if(x == 0 && y > 0){
				z +=  y * i;
				break;
			 }
			 else if(y == 0 && x > 0){
				z +=  x * i;
				break;
			 }
             else{
                z += a * i;
                i = i * 10;
                z += a * i;
             }
             i = i * 10;
             x = x / 10;
             y = y / 10;
     }
     cout << z;
}