#include<cstdio>
#include<string>
#include<iostream>
using namespace std;
string a,b,c;
int ab,ac,bc;

int find_bigger(string a, string b) {
    int idx=0,cnt=0;
    string s1,s2;
    s1=a+b;
    s2=b+a;
    while (!idx && cnt<s1.size()) {
        if (s1[cnt]>s2[cnt]) idx=1;
        else if (s2[cnt]>s1[cnt]) idx=2;
        else cnt++;
    }
    if (!idx) idx=1;
    return idx;
}

void output() {
    if (ab==1 && ac==1 && bc==1) cout << a << b << c << endl;
//    else if (ab==1 && ac==2 && bc==1) cout << a << b << c << endl;
    else if (ab==1 && ac==1 && bc==2) cout << a << c << b << endl;
    else if (ab==1 && ac==2 && bc==2) cout << c << a << b << endl;
    else if (ab==2 && ac==1 && bc==1) cout << b << a << c << endl;
    else if (ab==2 && ac==2 && bc==1) cout << b << c << a << endl;
//    else if (ab==2 && ac==1 && bc==2) cout << a << b << c << endl;
    else if (ab==2 && ac==2 && bc==2) cout << c << b << a << endl;
}

int main() {
    cin >> a >> b >> c;

    ab=find_bigger(a,b);
    ac=find_bigger(a,c);
    bc=find_bigger(b,c);

    output();

    return 0;
}