import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int N = sc.nextInt();
      	int L = sc.nextInt();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections 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();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int N = sc.nextInt();
      	int L = sc.nextInt();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
      	int N = sc.nextInt();
      	int L = sc.nextInt();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	} 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 String[] strs = new String [N+1]; strs new String [N+1] N+1 N 1 for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        } int i =0; int i =0; i 0 i<N+1 i N+1 N 1 i++ i++ i {
          	String string = sc.nextLine();
        	strs[i] = string;
        } {
          	String string = sc.nextLine();
        	strs[i] = string;
        } String string = sc.nextLine(); string sc.nextLine() sc.nextLine sc strs[i] = string strs[i] strs i string Arrays.sort(strs) Arrays.sort Arrays strs String str = ""; str "" for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        } int i =0; int i =0; i 0 i<N+1 i N+1 N 1 i++ i++ i {
        	str += strs[i];
        } {
        	str += strs[i];
        } str += strs[i] str strs[i] strs i System.out.println(str) System.out.println System.out System System.out str sc.close() sc.close sc 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();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int N = sc.nextInt();
      	int L = sc.nextInt();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	}
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int N = sc.nextInt();
      	int L = sc.nextInt();
      	String[] strs = new String [N+1];
      	for (int i =0; i<N+1 ; i++){
          	String string = sc.nextLine();
        	strs[i] = string;
        }
        Arrays.sort(strs);
        String str = "";
        for (int i =0; i<N+1 ; i++){
        	str += strs[i];
        }
        System.out.println(str);
   		sc.close();
	}
}