#include <iostream>
using namespace std;
int main(){
    string a, b, c;
    cin>>a>>b>>c;
    string x,y,z,p,m,n;
    x=a+b+c;
    y=a+c+b;
    z=b+a+c;
    p=b+c+a;
    m=c+a+b;
    n=c+b+a;
    
    if(x>=y and x>=z and x>=p and x>=m and x>=n){
        cout<<x<<endl;
    }
    else if(y>=x and y>=z and y>=p and y>=m and y>=n){
        cout<<y<<endl;
    }
    else if(z>=x and z>=y and z>=p and z>=m and z>=n){
        cout<<z<<endl;
    }
    else if(p>=x and p>=z and p>=y and p>=m and p>=n){
        cout<<p<<endl;
    }
    else if(m>=x and m>=z and m>=y and m>=p and m>=n){
        cout<<m<<endl;
    }
    else{
        cout<<n<<endl;
    }
    
    return 0;
     
}