using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NADOVEZIVANJE
{
    class Program
    {   static string veci(string s1, string s2)
        {
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] > s2[i]) return s1;
                if (s2[i] > s1[i]) return s2;
            }
            return s1;
        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int p = s.IndexOf(" ");
            string s1 = s.Substring(0, p);
            s = s.Substring(p+1);
            p = s.IndexOf(" ");
            string s2 = s.Substring(0, p);
            string s3 = s.Substring(p+1);
            string x1, x2, x3, x4, x5, x6;
            x1 = s1 + s2 + s3;
            x2 = s1 + s3 + s2;
            x3 = s2 + s1 + s3;
            x4 = s2 + s3 + s1;
            x5 = s3 + s1 + s2;
            x6 = s3 + s2 + s1;
            string x = x1;
            x = veci(x, x2);
            x = veci(x, x3);
            x = veci(x, x4);
            x = veci(x, x5);
            x = veci(x, x6);
            Console.WriteLine(x);
        }
    }
}