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

public class Main {

    public static void main(String args[]) throws Exception {

        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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

        System.out.println(result);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String args[]) throws Exception {

        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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

        System.out.println(result);
    }
} Main public static void main(String args[]) throws Exception {

        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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

        System.out.println(result);
    } 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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

        System.out.println(result);
    } 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 String result = ""; result "" for (int i=0; i < S.length; i++) {
            result = result + S[i];
        } int i=0; int i=0; i 0 i < S.length i S.length S S.length i++ i++ i {
            result = result + S[i];
        } {
            result = result + S[i];
        } result = result + S[i] result result + S[i] result S[i] S i System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) throws Exception {

        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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

        System.out.println(result);
    }
} public class Main {

    public static void main(String args[]) throws Exception {

        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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

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

public class Main {

    public static void main(String args[]) throws Exception {

        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);

        String result = "";
        for (int i=0; i < S.length; i++) {
            result = result + S[i];
        }

        System.out.println(result);
    }
}