import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

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

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

        System.out.println(solve(S));

        sc.close();
    }

    static String solve(String[] S) {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.stream.Collectors; Collectors java.util.stream public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        System.out.println(solve(S));

        sc.close();
    }

    static String solve(String[] S) {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        System.out.println(solve(S));

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

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

        System.out.println(solve(S));

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N for (int i = 0; i < S.length; ++i) {
            S[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < S.length i S.length S S.length ++i ++i i {
            S[i] = sc.next();
        } {
            S[i] = sc.next();
        } S[i] = sc.next() S[i] S i sc.next() sc.next sc System.out.println(solve(S)) System.out.println System.out System System.out solve(S) solve S sc.close() sc.close sc String[] args args static String solve(String[] S) {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    } solve {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    } return Arrays.stream(S).sorted().collect(Collectors.joining()); Arrays.stream(S).sorted().collect(Collectors.joining()) Arrays.stream(S).sorted().collect Arrays.stream(S).sorted() Arrays.stream(S).sorted Arrays.stream(S) Arrays.stream Arrays S Collectors.joining() Collectors.joining Collectors String[] S S public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        System.out.println(solve(S));

        sc.close();
    }

    static String solve(String[] S) {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        System.out.println(solve(S));

        sc.close();
    }

    static String solve(String[] S) {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    }
} Main
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

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

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

        System.out.println(solve(S));

        sc.close();
    }

    static String solve(String[] S) {
        return Arrays.stream(S).sorted().collect(Collectors.joining());
    }
}