#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
#define forn(a,b,c) for(int a=b;a<c;a++)
#define ford(a,b,c) for(int a=b;a>=c;a--)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s1,s2,s3,ans,a;
    cin >> s1 >> s2 >> s3;
    ans = s1 + s2 + s3;
    a = s1 + s3 + s2;
    if(a > ans)
        ans = a;
    a = s2 + s1 + s3;
    if(a > ans)
        ans = a;
    a = s2 + s3 + s1;
    if(a > ans)
        ans = a;
    a = s3 + s1 + s2;
    if(a > ans)
        ans = a;
    a = s3 + s2 + s1;
    if(a > ans)
        ans = a;
    cout << ans;
    return 0;
}