#include <iostream>
using namespace std;
string a, b, c, cur, cur_max;

string generation(int x){
	string gen;
	if(x == 1){
		//abc
		gen = a + b + c;
		return gen;
	}
	if(x == 2){
		//acb
		gen = a + c + b;
		return gen;
	}
	if(x == 3){
		//bac
		gen = b + a + c;
		return gen;
	}
	if(x == 4){
		//bca
		gen = b + c + a;
		return gen;
	}
	if(x == 5){
		//cab
		gen = c + a + b;
		return gen;
	}
	if(x == 6){
		//cba
		gen = c + b + a; 
		return gen;
	}
}

int main(){
	cin >> a >> b >> c;
	
	cur_max = generation(1);

	for(int i = 2; i <= 6; i++){
		cur = generation(i);
		if(cur > cur_max) cur_max = cur;
	}
	cout << cur_max;
}