#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string s[6];
int main(){
	string s1,s2,s3;
	cin>>s1>>s2>>s3;
	s[0]=s1+s2+s3;
	s[1]=s1+s3+s2;
	s[2]=s2+s1+s3;
	s[3]=s2+s3+s1;
	s[4]=s3+s1+s2;
	s[5]=s3+s2+s1;
	sort(s,s+6);
	cout<<s[5];
}