#include <iostream>
#include <string>

using namespace std;

int main()
{
    string a,b,c;
    cin >> a >> b >> c;
    string res = a+b+c;
    string g[6] = {a+c+b,b+a+c,b+c+a,c+a+b,c+b+a};
    for(int i = 0;i<6;i++){
        if(res<g[i]){
            res = g[i];
        }
    }
    cout << res << endl;
    return 0;
}