#include<iostream>
using namespace std;
string a, b, c, abc[6];
int main(){

    cin >> a >> b >> c;
    abc[0] = a + b + c;
    abc[1] = a + c + b;
    abc[2] = b + a + c;
    abc[3] = b + c + a;
    abc[4] = c + a + b;
    abc[5] = c + b + a;
    for(int i = 0; i < 6; i++){
        bool maxx = true;
        for(int j = 0; j < 6; j++)
            if(i != j)
                if(abc[i] < abc[j])
                    maxx = false;
        if(maxx){
            cout << abc[i];
            return 0;
        }
    }

    return 0;
}