import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
import java.util.Collections;
import java.lang.*;
import java.io.*;

public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	}
} import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	}
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	} main {
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	} 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 List<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 System.out.println(String.join("", list)) System.out.println System.out System System.out String.join("", list) String.join String "" list String[] args args public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	}
} public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	}
} Main
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
import java.util.Collections;
import java.lang.*;
import java.io.*;

public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> list = new ArrayList<>();

        for(int i = 0; i < n; i++){
            list.add(sc.next());
        }
        Collections.sort(list);
        //System.out.println(list);
        System.out.println(String.join("", list));

	}
}