import java.util.*;
import java.io.File;
import java.io.PrintWriter;
import java.io.FileNotFoundException;

public class number_pm {

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new File("number.in"));
        PrintWriter out = new PrintWriter("number.out");

        List<String> ss = new ArrayList<String>();
        while (in.hasNext()) {
            ss.add(in.next());
        }
        Collections.sort(ss, new Comparator<String>() {
            public int compare(String a, String b) {
                return - (a + b).compareTo(b + a);
            }
        });
        for (String s : ss) {
            out.print(s);
        }
        out.println();
        out.close();
    }
}
