#include <iostream>
#include<string>
using namespace std;

int main()
{
    string a , b, c ;
    getline(cin,a);
    getline (cin,b);
    getline(cin,c);
    string n1,n2,n3,n4,n5,n6;
    n1+=a; n1+=b; n1+=c;
    n2+=a; n2+=c; n2+=b;
    n3+=b; n3+=a; n3+=c;
    n4+=b; n4+=c; n4+=a;
    n5+=c; n5+=a; n5+=b;
    n6+=c; n6+=b; n6+=a;
    int i = 0;
    string maks="0";
    if(n1>=maks)
        maks=n1;
    if(n2>=maks)
        maks=n2;
        if(n3>=maks)
        maks=n3;
        if(n4>=maks)
        maks=n4;
        if(n5>=maks)
        maks=n5;
        if(n6>=maks)
        maks=n6;
        cout<<maks;
    return 0;
}