#include <iostream>

using namespace std;
bool poredjenje(string A, string B, int i){
    if(A[i] > B[i]){
        return true;
    }
    else if(A[i] < B[i])
        return false;
    else
       return poredjenje(A,B, i+1);
}
int main()
{
    string A, B, C;
    cin >> A >> B >> C;
    if(poredjenje(A,B,0)){
        if(poredjenje(A,C,0)){
            cout << A;
            if(poredjenje(B,C,0)){
                cout << B << C;
            }
            else
                cout << C << B;
        }
        else
            cout << C << A << B;
    }
    else{
        if(poredjenje(B,C,0)){
            cout << B;
            if(poredjenje(A,C,0))
                cout << A << C;
            else
                cout << C << A;
        }
        else
            cout << C << B << A;
    }
    return 0;
}