import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io 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);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int L = Integer.parseInt(sc.next()); L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] S = new String[N]; S new String[N] N String s = ""; s "" 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 for (int i = 0; i < N; i++) {
            s += S[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            s += S[i];
        } {
            s += S[i];
        } s += S[i] s S[i] S i PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(s) out.println out s sc.close() sc.close sc out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    }
} Main
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String[] S = new String[N];
        String s = "";

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

        Arrays.sort(S);

        for (int i = 0; i < N; i++) {
            s += S[i];
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(s);

        sc.close();
        out.flush();
    }
}