#include <bits/stdc++.h>
#include <string>

using namespace std;

string A,B,C;

string br1,br2,br3,br4,br5,br6;
string p,d,t;
string kraj;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cerr.tie(0);

    cin>>A>>B>>C;
    br1=A+B+C;
    br2=A+C+B;
    br3=B+A+C;
    br4=B+C+A;
    br5=C+A+B;
    br6=C+B+A;

    if(br1>=br2)
        p=br1;
    else
        p=br2;
    if(br3>=br4)
        d=br3;
    else
        d=br4;
    if(br5>=br6)
        t=br5;
    else
        t=br6;
    if(p>=d&&p>=t)
        kraj=p;
    else
        if(d>=p&&d>=t)
            kraj=d;
        else
            kraj=t;
    cout<<kraj;




    return 0;
}