#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
string sol = "";
void bigmax(string s){
    if(s.size() > sol.size()){
        sol = s;
        return;
    }
    else if(s.size() == sol.size()){
        for(long i = 0; i < s.size(); i++){
            if(s[i] != sol[i]){
                if(s[i] > sol[i]){
                    sol = s;
                    return;
                }
                else{
                    return;
                }
            }
        }
    }
}
vector <string> v;
ll id[3];
int main(){
    ios_base::sync_with_stdio(false);
    string a,b,c;
    cin >> a >> b >> c;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    id[0] = 0;
    id[1] = 1;
    id[2] = 2;
    do{
        string r = v[id[0]] + v[id[1]] + v[id[2]];
        bigmax(r);
    }while(next_permutation(id,id+3));
    cout << sol << endl;
}