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

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {

            
            string r = Console.ReadLine();
            string r1 = r.Substring(0,r.IndexOf(" "));
            r = r.Substring(r.IndexOf(" ") + 1);
            string r2 = r.Substring(0, r.IndexOf(" "));
            string r3 = r.Substring(r.IndexOf(" ") + 1);
            string max;
            string min;
            string srednji = r3;
            if (r1[0] > r2[0])
            {
                min = r2;
                max = r1;
            }
            else if (r1[0] < r2[0])
            {
                min = r1;
                max = r2;
            }
            else
            {
                Int64 t1 = Convert.ToInt64(r1);
                Int64 t2 = Convert.ToInt64(r2);
                if (t1 > t2)
                {
                    max = r1;
                    min = r2;
                }
                else
                {
                    max = r2;
                    min = r1;
                }
            }
            if (max[0] < r3[0])
            {
                srednji = max;
                max = r3;

            }
            else if (min[0] > r3[0])
            {
                srednji = min;
                min = r3;
            }
            else if (max[0] == r3[0])
            {

                Int64 t1 = Convert.ToInt64(max);
                Int64 t2 = Convert.ToInt64(r3);
                if (t1 < t2)
                {
                    srednji = max;
                    max = r3;
                }
            }
            else if (min[0] == r3[0])
            {

                Int64 t1 = Convert.ToInt64(min);
                Int64 t2 = Convert.ToInt64(r3);
                if (t1 > t2)
                {
                    srednji = min;
                    min = r3;
                }
            }
            else
            {
                srednji = r3;
            }

            Console.WriteLine(max+srednji+min);

        }
    }
}