import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    } try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        } {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int L = in.nextInt(); L in.nextInt() in.nextInt in String[] S = new String[N]; S new String[N] N for (int i = 0; i < N; i++) {
                S[i] = in.next();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                S[i] = in.next();
            } {
                S[i] = in.next();
            } S[i] = in.next() S[i] S i in.next() in.next in Arrays.sort(S) Arrays.sort Arrays S StringBuilder res = new StringBuilder(); res new StringBuilder() for (int i = 0; i < N; i++) {
                res.append(S[i]);
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                res.append(S[i]);
            } {
                res.append(S[i]);
            } res.append(S[i]) res.append res S[i] S i System.out.println(res.toString()) System.out.println System.out System System.out res.toString() res.toString res String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int L = in.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = in.next();
            }

            Arrays.sort(S);

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < N; i++) {
                res.append(S[i]);
            }

            System.out.println(res.toString());
        }
    }
}
