import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) final int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int L = Integer.parseInt(sc.next()); L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] ss = new String[N]; ss new String[N] N for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            ss[i] = sc.next();
        } {
            ss[i] = sc.next();
        } ss[i] = sc.next() ss[i] ss i sc.next() sc.next sc Arrays.sort(ss) Arrays.sort Arrays ss String ans = ""; ans "" for (int i = 0; i < N; i++) {
            ans += ss[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            ans += ss[i];
        } {
            ans += ss[i];
        } ans += ss[i] ans ss[i] ss i out.println(ans) out.println out ans out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final int N = Integer.parseInt(sc.next());
        final int L = Integer.parseInt(sc.next());
        String[] ss = new String[N];
        for (int i = 0; i < N; i++) {
            ss[i] = sc.next();
        }
        
        Arrays.sort(ss);
        String ans = "";
        for (int i = 0; i < N; i++) {
            ans += ss[i];
        }
        
        out.println(ans);
        
        out.flush();
    }
}