#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string a,b,c,br,br1,br2,t,br3,br4,br5;
int r,o,k,l,m,n;
int main (){
cin>>a>>b>>c;
br1=a+b+c;
br2=a+c+b;
br=b+a+c;
br3=b+c+a;
br4=c+b+a;
br5=c+a+b;
if(br1>=br and br1>=br2 and br1>=br3 and br1>=br4 and br1>=br5){
    cout<<br1;
    return 0;
}
if(br>=br1 and br>=br2 and br>=br3 and br>=br4 and br>=br5){
    cout<<br;
    return 0;
}
if(br2>=br and br2>=br1 and br2>=br3 and br2>=br4 and br2>=br5){
    cout<<br2;
    return 0;
}
if(br3>=br and br3>=br2 and br3>=br1 and br3>=br4 and br3>=br5){
    cout<<br3;
    return 0;
}
if(br4>=br and br4>=br2 and br4>=br3 and br4>=br1 and br4>=br5){
    cout<<br4;
    return 0;
}
if(br5>=br and br5>=br2 and br5>=br3 and br5>=br4 and br5>=br1){
    cout<<br5;
    return 0;
}
return 0;
}