#include<bits/stdc++.h>
using namespace std;

int main() {
    string a[3];
    for(int i = 0 ; i < 3 ; i++)
        cin >> a[i];

    string res = a[0] + a[1] + a[2];

    do {

        string tmp = a[0] + a[1] + a[2];
        // cout << tmp << endl;
        res = max(res, tmp);

    } while(next_permutation(a, a + 3));

    cout << res;

    return 0;
}