import java.util.*;
public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	}
}
 

 
 import java.util.*; util.* java public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	}
} Main public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	} main {
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int L = scanner.nextInt(); L scanner.nextInt() scanner.nextInt scanner String[] arrayOfWords = new String[N]; arrayOfWords new String[N] N for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        } {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        } arrayOfWords[i] = scanner.next() arrayOfWords[i] arrayOfWords i scanner.next() scanner.next scanner Arrays.sort(arrayOfWords) Arrays.sort Arrays arrayOfWords String answer = ""; answer "" for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        	answer = answer + arrayOfWords[i];
        } {
        	answer = answer + arrayOfWords[i];
        } answer = answer + arrayOfWords[i] answer answer + arrayOfWords[i] answer arrayOfWords[i] arrayOfWords i System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	}
} public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int N = scanner.nextInt();
      	int L = scanner.nextInt();
      
      	String[] arrayOfWords = new String[N];

      	for(int i = 0; i < N; i++) {
          	arrayOfWords[i] = scanner.next();
          	//System.out.println(arrayOfWords[i]);
        }
      
      	Arrays.sort(arrayOfWords);
      
      	String answer = "";
         
      	for(int i = 0; i < N; i++) {
        	answer = answer + arrayOfWords[i];
        }
          
       	System.out.println(answer);  	
	}
}
 

 

