#include <bits/stdc++.h>

using namespace std;
int main()
{
string A,B,C;
int AbigB,AbigC,BbigC;
cin >> A >> B >> C;
int n = A.length();
char a[n+1];
strcpy(a, A.c_str());
int n1 = B.length();
char b[n1+1];
strcpy(b, B.c_str());
int n2 = C.length();
char c[n2+1];
strcpy(c, C.c_str());

AbigB = strcmp(a,b);
AbigC = strcmp(a,c);
BbigC = strcmp(b,c);
if(AbigB > 0 ) AbigB = 1; else AbigB = 0;
if(AbigC > 0 ) AbigC = 1; else AbigC = 0;
if(BbigC > 0 ) BbigC = 1; else BbigC = 0;
string sol;
     if(AbigB && AbigC && BbigC)   sol = A + B + C;
else if(AbigB && AbigC && !BbigC)  sol = A + C + B;
else if(!AbigB && AbigC && BbigC)  sol = B + A + C;
else if(!AbigB && !AbigC && BbigC) sol = B + C + A;
else if(AbigB && !AbigC && !BbigC) sol = C + A + B;
else if(!AbigB && !AbigC && !BbigC)sol = C + B + A;
else sol = A + B + C;
int n3 = sol.length();
char r[n3+1];
strcpy(r, sol.c_str());
string s[3];
s[0] = A; s[1] = B; s[2] = C;
sort(s,s+3);
string s1 = s[0]+s[1]+s[2];
int n4 = s1.length();
char r1[n4 + 1];
strcpy(r1, s1.c_str());
int x = strcmp(r,r1);
if(x > 0 ) x = 1; else x = 0;
if(x) cout << r; else cout << r1;


return(0);
}