#include <bits/stdc++.h>

void cmp(std::vector<int> &x,std::vector<int> &y,std::vector<int> &z)
{
    int i=0;
    for (i; i < y.size(); i++)
    {
        if(x[i]>y[i]) z.push_back(x[i]);
        if(x[i]<y[i]) z.push_back(y[i]);
        if(x[i]==y[i])
        {
            z.push_back(y[i]);
            z.push_back(y[i]);
        }
    }
    for (i; i < x.size(); i++)
    {
        z.push_back(x[i]);
    }
}

int solve(int x,int y)
{
    int result = 0;
    std::vector<int> xc;
    std::vector<int> yc;
    std::vector<int> zc;
    
    while (x!=0)
    {
        xc.push_back(x%10);
        x=x/10;
    }
    while (y!=0)
    {
        yc.push_back(y%10);
        y=y/10;
    }
    
    
    if(xc.size()>=yc.size())
        cmp(xc,yc,zc);
    else cmp(yc,xc,zc);

    int k=1;

    for(int i:zc)
    {
        result+=i*k;
        k*=10;
    }
    

    return result;
}


int main()
{
    int x,y;
    std::cin>>x>>y;
    std::cout<<solve(x,y);
    return 0;
}