#include <iostream>

#define ull unsigned long long

using namespace std;

void next(string &s, string a, string b, string c) {

    s = a + b + c;
}

int main() {

    string a, b, c, s, s1;

    cin >> a >> b >> c;

    next(s, a, b, c);
    next(s1, a, c, b);

    if(s1 > s)
        s = s1;

    next(s1, b, a, c);

    if(s1 > s)
        s = s1;

    next(s1, b, c, a);

    if(s1 > s)
        s = s1;

    next(s1, c, a, b);

    if(s1 > s)
        s = s1;

    next(s1, c, b, a);

    if(s1 > s)
        s = s1;

    cout << s << endl;
    return 0;
}