#include <iostream>

using namespace std;

int main()
{
    long long int s1,s2,i,j,x1,x2,u1,u2,o;
    cin>>s1>>s2;
    long long int db=0;
    long long int szam=0;
    x1=s1;
    x2=s2;

    //cout<<db<<endl;
      while(s1!=0)
    {
       db++;
       s1=s1/10;
    }
        while(s2!=0)
    {
       db++;
       s2=s2/10;
    }
    o=0;
    int t=1;
    if(x1==x2)
    {
        while(o!=db/2)
           {
                t=t*10;
                o++;
           }
           szam=szam+t*x1+x2;
          cout<<szam;
    }

    else
    {

    long long int tomb[db];
    for(i=0;i<db;i++)
        tomb[i]=-1;
   // cout<<db<<endl;
    /* for(i=0;i<db;i++)
        cout<<tomb[i]<<" ";
        cout<<endl;*/
    long long int k=0;
     while((x1!=0)&&(x2!=0))
    {
        u1=x1 % 10;
        x1 = (x1/ 10);
        u2=x2 % 10;
        x2 = (x2/ 10);
        /*cout<<"x1= "<<x1<<" x2 ="<<x2<<endl;
        cout<<u1<<" "<<u2<<endl;*/
        if(u1>u2)
        {
             tomb[k]=u1;
             k++;
        }
        else if(u2>u1)
            {
                tomb[k]=u2;
                k++;
            }
        else if(u2==u1)
            {
                tomb[k]=u1;
                k++;
                tomb[k]=u2;
                k++;
            }
        else if(x2==0)
        {
            tomb[k]=u1;
            k++;
        }
        else if(x1==0)
        {
            tomb[k]=u2;
            k++;
        }
    }
   /* cout<<"TOMB"<<endl;
     for(i=0;i<db;i++)
        cout<<tomb[i]<<" ";
        cout<<endl;
    cout<<"MI LESZ A SZAM"<<endl;*/
    i=0;
    while(tomb[i]!=-1)
    {
        /*cout<<tomb[i]<<endl;
        cout<<"koala"<<endl;*/
        i++;
    }
    long long int m=0;
   /* cout<<endl;
    cout<<i<<endl;*/

    long long int fel=i-1;
    long long int tn=1;
    for(j=fel;j>=0;j--)
    {
        m=0;
        tn=1;
        while(m!=fel)
        {
            tn=tn*10;
            m++;
        }
        //cout<<fel<< " "<<tn<<endl;
        szam=szam+tn*tomb[fel];
        fel--;
        cout<<szam<<endl;
    }
    }
    return 0;
}