#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a,b;
    cin >> a >> b;
    int c = 0;
    int n,m;
    int k = 1;
    while(a>0 && b>0){
        n=a%10; m=b%10; a/=10; b/=10;
        if(n==m){
            k*=100;
            c+=n*k+m*(k/10);
        }
        else{
            k*=10;
            c+=max(n,m)*k;
        }
    }
    c /= 10;

    if(a>0)
        cout << a << c << endl;
    else
    if(b>0)
        cout << b << c << endl;
    else
        cout << c << endl;
    return 0;
}