import java.io.BufferedReader;
import java.io.IOException;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.File;
import java.util.*;

public class Main {

    public static StringBuilder output = new StringBuilder();

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    }

}

class Solver {
    public void solve(String arr[]) {
        String a = "";
        Arrays.sort(arr);
        for (String s : arr) {
            a = a.concat(s);
        }
        Main.output.append(a);

    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.FileWriter; FileWriter java.io import java.io.PrintWriter; PrintWriter java.io import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.io.BufferedWriter; BufferedWriter java.io import java.io.FileReader; FileReader java.io import java.io.File; File java.io import java.util.*; util.* java public class Main {

    public static StringBuilder output = new StringBuilder();

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    }

} Main public static StringBuilder output = new StringBuilder(); output new StringBuilder() public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int length = in.nextInt(); length in.nextInt() in.nextInt in String arr[] = new String[n]; arr new String[n] n for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            arr[i] = in.next();
        } {
            arr[i] = in.next();
        } arr[i] = in.next() arr[i] arr i in.next() in.next in Solver solver = new Solver(); solver new Solver() solver.solve(arr) solver.solve solver arr System.out.println(output) System.out.println System.out System System.out output String[] args args class Solver {
    public void solve(String arr[]) {
        String a = "";
        Arrays.sort(arr);
        for (String s : arr) {
            a = a.concat(s);
        }
        Main.output.append(a);

    }
} Solver public void solve(String arr[]) {
        String a = "";
        Arrays.sort(arr);
        for (String s : arr) {
            a = a.concat(s);
        }
        Main.output.append(a);

    } solve {
        String a = "";
        Arrays.sort(arr);
        for (String s : arr) {
            a = a.concat(s);
        }
        Main.output.append(a);

    } String a = ""; a "" Arrays.sort(arr) Arrays.sort Arrays arr for (String s : arr) {
            a = a.concat(s);
        } String s arr {
            a = a.concat(s);
        } {
            a = a.concat(s);
        } a = a.concat(s) a a.concat(s) a.concat a s Main.output.append(a) Main.output.append Main.output Main Main.output a String arr[] arr public class Main {

    public static StringBuilder output = new StringBuilder();

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    }

} public class Main {

    public static StringBuilder output = new StringBuilder();

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.File;
import java.util.*;

public class Main {

    public static StringBuilder output = new StringBuilder();

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int length = in.nextInt();
        String arr[] = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.next();
        }
        Solver solver = new Solver();
        solver.solve(arr);
        System.out.println(output);
    }

}

class Solver {
    public void solve(String arr[]) {
        String a = "";
        Arrays.sort(arr);
        for (String s : arr) {
            a = a.concat(s);
        }
        Main.output.append(a);

    }
}