#include <iostream>
#include <math.h>
#include <string>

using namespace std;

int main()
{
    string A,B,C,N,bigger ("a"),smaller,bigger1 ("a"),smaller1,F,S,T;
    int ALength,BLength,CLength,i=0;
    cin >> A >> B >> C;
    ALength=A.length();
    BLength=B.length();
    CLength=C.length();

        while(bigger=="a")
        {
            if(A[i]>B[i])
            {
                bigger=A;
                smaller=B;
            }
            else
            if(A[i]<B[i])
            {
                bigger=B;
                smaller=A;
            }
            i++;
        }
        i=0;
        while(bigger1=="a")
        {
            if(C[i]>B[i])
            {
                bigger1=C;
                smaller1=B;
            }
            else
            if(C[i]<B[i])
            {
                bigger1=B;
                smaller1=C;
            }
            i++;
        }
    if(bigger>=bigger1)
        F=bigger;
    else
        F=bigger1;
    if(smaller<smaller1)
        T=smaller;
    else
        T=smaller1;

    if(F>A && A>T)
        S=A;
    else
        if(F>B && B>T)
            S=B;
        else
            if(F>C && C>T)
                S=C;
            else
            {
                S=A;
                if(B>S)
                    S=B;
                else
                    S=C;
            }
    cout << F << S << T << endl;
    return 0;
}