#include <iostream>

using namespace std;

int main()
{
    string sa,sb,sc,ans,tes;
    cin>>sa;
    cin>>sb;
    cin>>sc;

    for(int k1 =0;k1<3;k1++)
        for(int k2=0;k2<3;k2++)
            if(k2!=k1)
            {
                for(int k3=0;k3<3;k3++)
                {

                    if(k3!=k2 && k3!=k1){
                        tes="";
                        switch(k1)
                        {
                            case 0:
                                tes+=sa;
                                break;
                            case 1:
                                tes+=sb;
                                break;
                            case 2:
                                tes+=sc;
                                break;
                        }
                        switch(k2)
                        {
                            case 0:
                                tes+=sa;
                                break;
                            case 1:
                                tes+=sb;
                                break;
                            case 2:
                                tes+=sc;
                                break;
                        }
                        switch(k3)
                        {
                            case 0:
                                tes+=sa;
                                break;
                            case 1:
                                tes+=sb;
                                break;
                            case 2:
                                tes+=sc;
                                break;
                        }
                        if(tes>ans)ans=tes;
                    }
                }
            }
    cout<<ans;
    //cout<<"n1 = "<<n1<<endl<<"n2 = "<<n2<<endl<<"n3 = "<<n3<<endl;
    return 0;
}