#include <bits/stdc++.h>
#include <string.h>
using namespace std;

int main(){

    string a,b,c;
    vector<string>res(6);
    cin>>a>>b>>c;

    res[0]=a+b+c;
    res[1]=a+c+b;
    res[2]=b+a+c;
    res[3]=b+c+a;
    res[4]=c+a+b;
    res[5]=c+b+a;

    for(int i = 0; i < 6; i++){
        int cnt = 0;
        for(int j = 0; j < 6; j++){
            if(res[i].compare(res[j])>= 0)
                cnt++;
        }
        if(cnt == 6){
            cout<<res[i];
            break;
        }
    }
}