#include <iostream>
#include <string>

using std::string;

int greater_str(const string &str1, const string &str2)
{
    for (string::size_type i = 0; i != str1.size(); ++i)
        if (str1[i] > str2[i])
            return 1;
        else if (str1[i] < str2[i])
            return 2;
    return 0;
}
int main()
{
    // strings to hold the numbers
    string num1, num2, num3;
    std::cin >> num1 >> num2 >> num3;
    // strings to hold combinations of numbers
    string comb1, comb2, comb3, comb4, comb5, comb6;

    // all combinations of 3 given numbers
    comb1 = num1 + num2 + num3;
    comb2 = num1 + num3 + num2;
    comb3 = num2 + num1 + num3;
    comb4 = num2 + num3 + num1;
    comb5 = num3 + num1 + num2;
    comb6 = num3 + num2 + num1;

    // find greatest number
    string *max_str = &comb1;
    if (greater_str(comb2, *max_str) == 1)
        max_str = &comb2;
    if (greater_str(comb3, *max_str) == 1)
        max_str = &comb3;
    if (greater_str(comb4, *max_str) == 1)
        max_str = &comb4;
    if (greater_str(comb5, *max_str) == 1)
        max_str = &comb5;
    if (greater_str(comb6, *max_str) == 1)
        max_str = &comb6;

    // print greatest number
    std::cout << *max_str << std::endl;

    return 0;
}