#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int checker = 0;
string a, b, c, x;
cin >> a >> b >> c;
int i = 0;
int *koef = (int*)calloc(4, sizeof(int));
if (a == b && b == c)
{
cout << a << b << c;
return 0;
}
if (stoull(a + c, nullptr, 0) > stoull(c + a, nullptr, 0))
koef[0] += 1;
if (stoull(c + a, nullptr, 0) > stoull(a + c, nullptr, 0))
koef[2] += 1;
if (stoull(a + b, nullptr, 0) > stoull(b + a, nullptr, 0))
koef[0] += 1;
if (stoull(b + a, nullptr, 0) > stoull(a + b, nullptr, 0))
koef[1] += 1;
if (stoull(b + c, nullptr, 0) > stoull(c + b, nullptr, 0))
koef[1] += 1;
if (stoull(c + b, nullptr, 0) > stoull(b + c, nullptr, 0))
koef[2] += 1;
if (koef[0] == *max_element(koef, koef + 3)) {
cout << a;
if (koef[1] > koef[2])
{
cout << b << c;
return 0;
}
else
{
cout << c << b;
return 0;
}
}
if (koef[1] == *max_element(koef, koef + 3)) {
cout << b;
if (koef[0] > koef[2])
{
cout << a << c;
return 0;
}
else
{
cout << c << a;
return 0;
}
}
if (koef[2] == *max_element(koef, koef + 3)) {
cout << c;
if (koef[0] > koef[1])
{
cout << a << b;
return 0;
}
else
{
cout << b << a;
return 0;
}
}
}