#include <iostream>
#include <string>

using namespace std;

bool strcompare(string x, string y){
	string tmp1=x, tmp2=y;
	
	tmp1.append(y);
	tmp2.append(x);
	
	if(tmp1.compare(tmp2)>0) return true;
	else return false;
}

int main()	{
	string abc[3];
	int max=0, min=0, mid=0;
	cin>>abc[0]>>abc[1]>>abc[2];
	if(strcompare(abc[1], abc[0]))
		max=1;
	else
		max=0;

	if(max==0)
		if(strcompare(abc[2], abc[0])) max=2;
	else if(max==1)
		if(strcompare(abc[2], abc[1])) max=2;

	if(max==0){
		if(strcompare(abc[1], abc[2])) min=2;
		else min=1;
	}
	else if(max==1){
		if(strcompare(abc[0], abc[2])) min=2;
		else min=0;
	}
	else if(max==2){
		if(strcompare(abc[0], abc[1])) min=1;
		else min=0;
	}
	
	if((max==2 && min==1)||(max==1&&min==2)) mid=0;
	else if((max==1 && min==0)||(max==0&&min==1)) mid=2;
	else if((max==0 && min==2)||(max==2&&min==0)) mid=1;
	
	cout<<abc[max];
	cout<<abc[mid];
	cout<<abc[min];
	
	return 0;
}