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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

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

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.StringJoiner; StringJoiner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

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

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

        }
        System.out.println(sj.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

        }
        System.out.println(sj.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
        } {
            s[i] = sc.next();
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s StringJoiner sj = new StringJoiner(""); sj new StringJoiner("") for (int j = 0; j < n; j++) {
            sj.add(s[j]);

        } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
            sj.add(s[j]);

        } {
            sj.add(s[j]);

        } sj.add(s[j]) sj.add sj s[j] s j System.out.println(sj.toString()) System.out.println System.out System System.out sj.toString() sj.toString sj String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

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

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

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

} Main
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        Arrays.sort(s);
        StringJoiner sj = new StringJoiner("");
        for (int j = 0; j < n; j++) {
            sj.add(s[j]);

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

}
