#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define forn(a,b,c) for(int a=b;a<=c;a++)
#define ford(a,b,c) for(int a=b;a>=c;a--)
const int N=2e5+5;
vector<string> a(3);string cur;
vector<int> arr={0,1,2};
bool veci(string a,string b){
    int curr=0;
    while(a[curr]==b[curr]){curr++;}
    if(curr==sz(a))return 1;
    if(a[curr]>=b[curr])return 1;
    return 0;
}
int main()
{
    cin>>a[0]>>a[1]>>a[2];
    cur=a[0]+a[1]+a[2];
    do{
        //cout<<a[arr[0]]<<" "<<a[arr[1]]<<" "<<a[arr[2]]<<endl;
        if(veci(a[arr[0]]+a[arr[1]]+a[arr[2]],cur)){
            cur=a[arr[0]]+a[arr[1]]+a[arr[2]];
        }
        //cout<<cur<<endl;
    }while(next_permutation(arr.begin(),arr.end()));
    cout<<cur<<endl;
    return 0;
}