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

namespace ConsoleApp17
{
    class Program
    {

        static bool Zadatak(string string1, string string2)
        {
            bool tf = false;
            int i = 0;
            for (; !tf && i < Math.Min(string1.Length, string2.Length); i++) 
            {
                if (Convert.ToInt64(string1[i]) < Convert.ToInt64(string2[i]))
                {
                    tf = true;
                    return true;                   
                }
                else if (Convert.ToInt64(string1[i]) > Convert.ToInt64(string2[i]))
                {
                    tf = true;
                }
            }
            if (!tf)
            {
                if (i == Math.Min(string1.Length, string2.Length))
                {
                    if (string1.Length < string2.Length)
                    {
                        if (Convert.ToInt64(string2[i]) > Convert.ToInt64(string1[0]))
                        {
                            return true;
                        }
                    }
                    else if (string1.Length > string2.Length)
                    {
                        if (Convert.ToInt64(string1[i]) < Convert.ToInt64(string2[0]))
                        {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
        
        static void zameni(ref string jedan, ref string dva)
        {
            string iks = jedan;
            jedan = dva;
            dva = iks;
        }

        static void Main(string[] args)
        {
            //string A = Console.ReadLine();
            //string B = Console.ReadLine();
            //string C = Console.ReadLine();

            string A = "10";
            string B = "102";
            string C = "10";

            if (Zadatak(A, B)) zameni(ref A, ref B);
            if (Zadatak(B, C)) zameni(ref A, ref B);
            if (Zadatak(A, B)) zameni(ref A, ref B);

            string stringg = A + B + C;
            Console.WriteLine(stringg);
            Console.ReadLine();
        }
    }
}