import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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 = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc ArrayList<String> list= new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < n; i++) {
            list.add(sc.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            list.add(sc.next());
        } {
            list.add(sc.next());
        } list.add(sc.next()) list.add list sc.next() sc.next sc Collections.sort(list) Collections.sort Collections list for (String ss : list) {
            System.out.print(ss);
        } String ss list {
            System.out.print(ss);
        } {
            System.out.print(ss);
        } System.out.print(ss) System.out.print System.out System System.out ss String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> list= new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.next());
        }
        Collections.sort(list);
        for (String ss : list) {
            System.out.print(ss);
        }
    }
}