#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    vector<int> a;
    vector<int> b;
    while(n>=1)
    {
        a.push_back(n%10);
        n/=10;
    }
    while(m>=1)
    {
        b.push_back(m%10);
        m/=10;
    }
    vector<int> rez;
    int vece=max(a.size(),b.size());
    int manje=min(a.size(),b.size());
    for(int i=0;i<manje;i++)
    {
        int x=max(a[i],b[i]);
        int y=min(a[i],b[i]);
        if(x!=y)
            rez.push_back(x);
        else
        {
            rez.push_back(x);
            rez.push_back(y);
        }
    }
    if(a.size()>b.size())
    {
        for(int i=manje;i<vece;i++)
            rez.push_back(a[i]);
    }
    else
        for(int i=manje;i<vece;i++)
            rez.push_back(b[i]);

    reverse(rez.begin(),rez.end());
    for(auto x : rez)
    {
        cout<<x;
    }
    return 0;
}