#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>

using namespace std;

vector<string> split_string(string input){
	vector<string> output;
	size_t poz;
	int i = 0;
	while((poz = input.find(' ')) != string::npos){
		output.push_back(input.substr(0, poz));
		input.erase(0, poz+1);
	}
	output.push_back(input);
	return output;
}

int cmp(string s1, string s2){
    int len1 = strlen(s1.c_str());
    int len2 = strlen(s2.c_str());
    if(len1 > len2){
        if(strncmp(s1.c_str(), s2.c_str(), len2) == 0){
            for(int i = len2; i < len1; i++){
                if(s1[i] < s2[len2-1])
                    return -1;
                if(s1[i] > s2[len2-1])
                    return 1;
            }
            return 0;
        }
    }
    if(len2 > len1){
        if(strncmp(s1.c_str(), s2.c_str(), len1) == 0){
            for(int i = len1; i < len2; i++){
                if(s2[i] > s1[len1-1])
                    return -1;
                if(s2[i] < s1[len1-1])
                    return 1;
            }
            return 0;
        }
    }
    return s1.compare(s2);
}

int test(string s1, string s2) {
	if (cmp(s1, s2) == 1 || cmp(s1, s2) == 0)
		return 1;
	return 0;
}

int main(){
	string input, output = "";
	getline(cin, input);
	vector<string> elements = split_string(input);
	if (test(elements[0], elements[1]) == 1) {
		if (test(elements[0], elements[2]) == 1) {
			output += elements[0];
			if (test(elements[1], elements[2]) == 1)
			{
				output += elements[1];
				output += elements[2];
			}
			else {
				output += elements[2];
				output += elements[1];
			}
		}
	}
	else {
		if (test(elements[1], elements[2]) == 1) {
			output += elements[1];
			if (test(elements[0], elements[2]) == 1) {
				output += elements[0];
				output += elements[2];
			}
			else {
				output += elements[2];
				output += elements[0];
			}
		}
		else {
			output += elements[2];
			output += elements[1];
			output += elements[0];
		}
	}
	printf("%s\n", output.c_str());
	return 0;
}