#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define f first
#define s second
#define ll long long
#define llu unsigned long long
#define pb push_back

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);

	string s1,s2,s3;
	cin >> s1 >> s2 >> s3;
	string r[6];
	r[1]=s1+s2+s3;
	r[2]=s1+s3+s2;
	r[3]=s2+s1+s3;
	r[4]=s2+s3+s1;
	r[5]=s3+s1+s2;
	r[0]=s3+s2+s1;

	string maxx=r[0];
	for(int i = 1;i<6;i++){
        for(int j = 0;j<r[0].size();j++){
            if(r[i][j]<maxx[j]){
                break;
            }
            else if(r[i][j]>maxx[j]){
                maxx=r[i];
            }
        }
	}

	cout << maxx;

    return 0;
}