#include <iostream>

using namespace std;

long long stvori(long long x,long long y)
{
    long long r=0;
    int c1,c2;
    while(x>0)
    {
        c1=x%10;
        c2=y%10;
        if(c1<c2)
        {
            r=r*10;
            r+=c2;
        }
        if(c1>c2)
        {
            r=r*10;
            r+=c1;
        }
        if(c1==c2)
        {
            r=r*10;
            r+=c1;
            r=r*10;
            r+=c2;
        }
        x=x/10;
        y=y/10;
    }
    while(y>0)
    {
        c1=y%10;
        r=r*10;
        r+=c1;
        y=y/10;
    }
    return r;
}

long long obrni(long long x)
{
    long long y=0;
    int c;
    while(x>0)
    {
        c=x%10;
        y=y*10;
        y+=c;
        x=x/10;
    }
    return y;
}

int main()
{
    long long x,y,r;
    cin>>x>>y;
    if(x>y)
    {
        r=x;
        x=y;
        y=r;
    }
    r=stvori(x,y);
    r=obrni(r);
    cout<<r;
}