#include<stdio.h>
#include <iostream>
#include<string>
using namespace std;
int main()
{
    int i,la,lb,lc,max,ab=0,bc=0,ac=0;
    string a,b,c,poma,pomb,pomc;
    cin >> a >> b >> c;
    poma=a;
    pomb=b;
    pomc=c;
    la=a.length();
    max=la;
    lb=b.length();
    if(lb>max)
        max=lb;
    lc=c.length();
    if(lc>max)
        max=lc;
    for(i=la;i<max;i++)
        a=a+"0";
    for(i=lb;i<max;i++)
        b=b+"0";
    for(i=lc;i<max;i++)
        c=c+"0";
    for(i=0;i<max;i++)
    {
        if(a[i]>b[i])
        {
            ab=1;
            break;
        }
        else
            if(a[i]<b[i])
            {
                ab=2;
                break;
            }
    }
    for(i=0;i<max;i++)
    {
        if(b[i]>c[i])
        {
            bc=1;
            break;
        }
        else
            if(b[i]<c[i])
            {
                bc=2;
                break;
            }
    }
    for(i=0;i<max;i++)
    {
        if(a[i]>c[i])
        {
            ac=1;
            break;
        }
        else
            if(a[i]<c[i])
            {
                ac=2;
                break;
            }
    }
    if(ab==1)
    {
        if(bc==1 || bc==0)
            cout << poma+pomb+pomc;
        else
            cout << pomc+poma+pomb;
    }
    else
    {
        if(ab==0)
        {
            if(bc==1 || bc==0)
                cout << poma+pomb+pomc;
            else
                cout << pomc+poma+pomb;
        }
        else
        {
            if(bc==0 || bc==2)
                cout << pomc+pomb+poma;
            else
            {
                if(ac==0 || ac==1)
                    cout << pomb+poma+pomc;
                else
                    cout << pomb+pomc+poma;
            }
        }

    }
    return 0;
}