#include <bits/stdc++.h>

using namespace std;

string niz[6];

bool sortiraj(string s1, string s2)
{
    if(strcmp(s1.c_str(), s2.c_str())>0) return false;
    return true;
}

int main()
{
    string a, b, c;
    cin >> a >> b >> c;
    string s1, s2, s3, s4, s5, s6;
    niz[0] = a + b + c;
    niz[1] = a + c + b;
    niz[2] = b + a + c;
    niz[3] = b + c + a;
    niz[4] = c + a + b;
    niz[5] = c + b + a;
    sort(niz, niz + 6, sortiraj);
    cout << niz[5];

    return 0;
}