#include<iostream>
using namespace std;
string a,b,c;
int main(){
    cin>>a>>b>>c;
    if(a[0]>=b[0]&& a[0]>=c[0]){
        cout<<a;
        if(b[0]>=c[0]){
            cout<<b;
            cout<<c;
        }
        else{
            cout<<c;
            cout<<b;
        }

    }
    else if(b[0]>=a[0]&& b[0]>=c[0]){
        cout<<b;
        if(a[0]>=c[0]){
            cout<<a;
            cout<<c;
        }
        else{
            cout<<c;
            cout<<a;
        }

    }
    else if(c[0]>=a[0]&& c[0]>=b[0]){
        cout<<c;
        if(a[0]>=b[0]){
            cout<<a;
            cout<<b;
        }
        else{
            cout<<b;
            cout<<a;
        }

    }




return 0;
}