#include <iostream>

using namespace std;

int main()
{
    string a,b,c;
    cin>>a>>b>>c;
    string s2 = a+c+b;
    string s3 = b+a+c;
    string s4 = b+c+a;
    string s5 = c+a+b;
    string s6 = c+b+a;
    string maxx=a+b+c;
    if(maxx<s2)maxx=s2;
    if(maxx<s3)maxx=s3;
    if(maxx<s4)maxx=s4;
    if(maxx<s5)maxx=s5;
    if(maxx<s6)maxx=s6;
    cout<<maxx;
    return 0;
}