#include <bits/stdc++.h>
using namespace std;

int main() {

  string a, b, c;
  cin >> a >> b >> c;

  string s =
      max(a + b + c,
          max(a + c + b,
              max(b + a + c, max(b + c + a, max(c + a + b, c + b + a)))));

  cout << s << endl;

  return 0;
}