#include <bits/stdc++.h>
#include<string>

using namespace std;

string uporedi(string a,string b)
{
    long long i,j;
    i = j = 0;
    char A = a[0];
    char B = b[0];

    while(i<a.length() || j<b.length())
    {
        if(i<a.length()) A = a[i];
        if(j<b.length()) B = b[j];
        if(A>B) return a;
        if(B>A) return b;

        i++;
        j++;
    }
    return b;
}

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

    string s1 = a+b+c;
    string s2 = a+c+b;
    string s3 = b+a+c;
    string s4 = b+c+a;
    string s5 = c+a+b;
    string s6 = c+b+a;

    string s = uporedi(uporedi(uporedi(uporedi(uporedi(s1,s2),s3),s4),s5),s6);
    cout<<s;


    return 0;
}