import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

        Arrays.sort(S);
        System.out.println(String.join("", S));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

        Arrays.sort(S);
        System.out.println(String.join("", S));
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

        Arrays.sort(S);
        System.out.println(String.join("", S));
    } main {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

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

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

        Arrays.sort(S);
        System.out.println(String.join("", S));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

        Arrays.sort(S);
        System.out.println(String.join("", S));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt(), L = scan.nextInt();

        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = scan.next();
        }

        Arrays.sort(S);
        System.out.println(String.join("", S));
    }
}
