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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

        System.out.println(sb.toString());
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

        System.out.println(sb.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

        System.out.println(sb.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] NL = sc.nextLine().split(" "); NL sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int n = Integer.parseInt(NL[0]); n Integer.parseInt(NL[0]) Integer.parseInt Integer NL[0] NL 0 int l = Integer.parseInt(NL[1]); l Integer.parseInt(NL[1]) Integer.parseInt Integer NL[1] NL 1 String[] S = new String[n]; S new String[n] n for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            S[i] = sc.nextLine();
        } {
            S[i] = sc.nextLine();
        } S[i] = sc.nextLine() S[i] S i sc.nextLine() sc.nextLine sc Arrays.sort(S) Arrays.sort Arrays S StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < n; i++) {
            sb.append(S[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            sb.append(S[i]);
        } {
            sb.append(S[i]);
        } sb.append(S[i]) sb.append sb S[i] S i System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] NL = sc.nextLine().split(" ");
        int n = Integer.parseInt(NL[0]);
        int l = Integer.parseInt(NL[1]);
        String[] S = new String[n];
        for (int i = 0; i < n; i++) {
            S[i] = sc.nextLine();
        }

        Arrays.sort(S);

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

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