using System;

namespace elsoFeladatMasodikFordulo
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            string[] x2 = x.Split(' ');

            int[] A = new int[x2[0].Length];
            int[] B = new int[x2[1].Length];
            int[] C = new int[x2[2].Length];

            bool a1 = false;
            bool a2 = false;
            bool a3 = false;

            for (int i = 0; i != x2[0].Length; i++)
            {
                A[i] = (int)Char.GetNumericValue(x2[0][i]);
            }
            for (int i = 0; i != x2[1].Length; i++)
            {
                B[i] = (int)Char.GetNumericValue(x2[1][i]);
            }
            for (int i = 0; i != x2[2].Length; i++)
            {
                C[i] = (int)Char.GetNumericValue(x2[2][i]);
            }

            
            for(int i = 0; i != x2[0].Length; i++)
            {
                try
                {
                    if (A[i] < B[i]) { a1 = true; }
                }catch (Exception){}
            }

            for (int i = 0; i != x2[0].Length; i++)
            {
                try
                {
                    if (A[i] < C[i]) { a2 = true; }
                }
                catch (Exception) { }
            }

            for (int i = 0; i != x2[1].Length; i++)
            {
                try
                {
                    if (B[i] < C[i]) { a3 = true; }
                }
                catch (Exception) { }
            }

            if (a1 && a2 && !a3)
            {//bca
                Console.WriteLine(x2[1] + x2[2] + x2[0]);
            }
            else
            if(a1 && a2 && a3)
            {//cba
                Console.WriteLine(x2[2] + x2[1] + x2[0]);
            }
            else
            if (a1 && !a2)
            {//bac
                Console.WriteLine(x2[1] + x2[0] + x2[2]);
            }
            else
            if (!a1 && a2)
            {//cab
                Console.WriteLine(x2[2] + x2[0] + x2[1]);
            }
            else
            if (!a1 && !a2 && a3)
            {//acb
                Console.WriteLine(x2[0] + x2[2] + x2[1]);
            }
            else
            if (!a1 && !a2 && !a3)
            {//abc
                Console.WriteLine(x2[0] + x2[1] + x2[2]);
            }
        }
    }
}