using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace CSharp_Shell
{

    public static class Program 
    {
        static bool f(string a,string b,int p)
        {
            if(a==b)return false;
            if(p<a.Length&&p<b.Length)
            {
                if(a[p]>b[p])return true;
                else if(a[p]<b[p])return false;
                return f(a,b,p+1);
            }
            if(p==a.Length)return f(a,b.Substring(p),0);
            return f(a.Substring(p),b,0);
        }
        public static void Main() 
        {
            
           string[]s=Console.ReadLine().Split();
           for(int i=0;i<3;i++)
           {
               for(int j=i+1;j<3;j++)
               if(f(s[j],s[i],0)){
                   string b=s[j];
                   s[j]=s[i];
                   s[i]=b;
               }
               Console.Write(s[i]);
           }
        }
    }
}