/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package nadovezivanje;

import java.util.Scanner;

/**
 *
 * @author Korisnik
 */
public class Nadovezivanje {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner skener=new Scanner(System.in);
        
        String A = skener.next();
        String B = skener.next();
        String C = skener.next();
        int n=0;
        int i = 0;
        char a1 = A.charAt(0);
        char b1 = B.charAt(0);
        char c1 = C.charAt(0);
        
        String sa=""+a1;
        String sb=""+b1;
        String sc=""+c1;
        
        if(A.length()<=B.length()&&A.length()<=C.length()){n=A.length();}
        if(B.length()<=A.length()&&B.length()<=C.length()){n=B.length();}
        if(C.length()<=A.length()&&C.length()<=B.length()){n=C.length();}
        
        while(sa.equals(sb)||sb.equals(sc)||sa.equals(sc)){
            if(i==(n-1)){break;}
            i=i+1;
            char a2 = A.charAt(i);
            char b2 = B.charAt(i);
            char c2 = C.charAt(i);
            sa=sa+a2;
            sb=sb+b2;
            sc=sc+c2;}
        
        
        int ba = Integer.parseInt(sa);
        int bb = Integer.parseInt(sb);
        int bc = Integer.parseInt(sc);
        
        
        if(ba==bb&&bb==bc&&ba==bc){
            System.out.println(A+B+C);}
        else if(ba==bb&&ba>bc){
            System.out.println(A+B+C);}
        else if(ba==bb&&ba<bc){
            System.out.println(C+A+B);}
        else if(bc==ba&&bc>ba){
            System.out.println(C+A+B);}
        else if(bc==ba&&ba>bc){
            System.out.println(A+B+C);}
        else if(bb==bc&&bb>ba){
            System.out.println(B+C+A);}
        else if(bb==bc&&ba>bb){
            System.out.println(A+B+C);}
        else{
            if(ba>bb&&ba>bc){
            if(bb>bc){
                System.out.println(A+B+C);}
            else{
                System.out.println(A+C+B);}}
        
        if(bb>ba&&bb>bc){
            if(ba>bc){
                System.out.println(B+A+C);}
            else{
                System.out.println(B+C+A);}}
        
        if(bc>ba&&bc>bb){
            if(ba>bb){
                System.out.println(C+A+B);}
            else{
                System.out.println(C+B+A);}}}
                        
        
    }
    
}