#include <bits/stdc++.h>

using namespace std;

int main()
{
    int x, y,k=0;
    int z[20];

    scanf("%d", &x);
    scanf("%d", &y);
    while(x>0 || y>0)
    {
        int a=x%10;
        int b=y%10;
        x/=10;
        y/=10;
        if(a==b)
        {
            z[k]=a;
            z[k+1]=a;
            k+=2;
        }else{
            z[k]=max(a,b);
            k++;
        }
    }

    for(int i=k-1;i>=0;i--)printf("%d",z[i]);

    return 0;
}