#include <iostream>
#include <string>
using namespace std;

string a, b, c, A, B, C, D, E, F;
int main () {

    cin>>a>>b>>c;

    A=a+b+c;
    B=a+c+b;
    C=c+a+b;
    D=c+b+a;
    E=b+a+c;
    F=b+c+a;

    if (A>=B and A>=C and A>=D and A>=E and A>=F) cout<<A<<endl;
    else if (B>=A and B>=C and B>=D and B>=E and B>=F) cout<<B<<endl;
    else if (C>=B and C>=B and C>=D and C>=E and C>=F) cout<<C<<endl;
    else if (D>=B and D>=C and D>=A and D>=E and D>=F) cout<<D<<endl;
    else if (E>=B and E>=C and E>=D and E>=A and E>=F) cout<<E<<endl;
    else if (F>=B and F>=C and F>=D and F>=E and F>=A) cout<<F<<endl;


    return 0;
}