import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintStream out = new PrintStream(System.out); out new PrintStream(System.out) ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() int N N L; L String state = ""; state "" N = sc.nextInt() N sc.nextInt() sc.nextInt sc L = sc.nextInt() L sc.nextInt() sc.nextInt sc for (int i = 0; i < N; i++) {
            list.add(sc.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            list.add(sc.next());
        } {
            list.add(sc.next());
        } list.add(sc.next()) list.add list sc.next() sc.next sc Collections.sort(list) Collections.sort Collections list for (int i = 0; i < N; i++) {
            state += list.get(i);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            state += list.get(i);
        } {
            state += list.get(i);
        } state += list.get(i) state list.get(i) list.get list i out.println(state) out.println out state sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintStream out = new PrintStream(System.out);
        ArrayList<String> list = new ArrayList<String>();
        int N, L;
        String state = "";

        N = sc.nextInt();
        L = sc.nextInt();

        for (int i = 0; i < N; i++) {
            list.add(sc.next());
        }

        Collections.sort(list);
        
        for (int i = 0; i < N; i++) {
            state += list.get(i);
        }
        
        out.println(state);
        sc.close();
    }
}