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

/*
Because a,b,c <= 10^18
that means that a, b, c will be at most 19 digit long
that means that the biggest compound number is 19*3 = 57
this is actually the n for our big-o notation
my algorithm is O(n)
*/

bool isBigger(string a, string b) {
    for (int i = 0; i < a.size(); i++) {
        if (a[i] > b[i])
            return true;
        if (a[i] < b[i])
            return false;
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(false);

    string a, b, c;

    cin >> a >> b >> c;
/*
    a = "437289478932382718";
    b = "547982473298473290";
    c = "324832943284322986";

    finishes in 0.19s
*/
    string s[6];

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

    string res1, res2, res3;

    res1 = isBigger(s[0], s[1]) ? s[0] : s[1];
    res2 = isBigger(s[2], s[3]) ? s[2] : s[3];
    res3 = isBigger(s[4], s[5]) ? s[4] : s[5];

    res2 = isBigger(res1, res2) ? res1 : res2;
    res3 = isBigger(res2, res3) ? res2 : res3;

    cout << res3;

    return 0;
}