#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int por(string a, string b)
{
    string ab = a.append(b);
    string ba = b.append(a);
    return ab.compare(ba) > 0 ? 1: 0;
}

void pr(vector<string> db)
{
    sort(db.begin(), db.end(), por);
    for (int i=0; i < db.size() ; i++ )
        cout << db[i];
}
int main()
{
    vector<string> db;
    string f,s,t;
    cin>>f>>s>>t;
    db.push_back(f);
    db.push_back(s);
    db.push_back(t);
    pr(db);
    return 0;
}