import java.util.Scanner;
import java.util.Arrays;

public class Main{

	public static void main(String args[]){
    	
      	Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int l = sc.nextInt();
      
        String ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays 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 ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    }
} Main public static void main(String args[]){
    	
      	Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int l = sc.nextInt();
      
        String ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    } main {
    	
      	Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int l = sc.nextInt();
      
        String ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    } 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 ary[] = new String[n]; ary new String[n] n for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	ary[i] = sc.next();
        } {
        	ary[i] = sc.next();
        } ary[i] = sc.next() ary[i] ary i sc.next() sc.next sc Arrays.sort(ary) Arrays.sort Arrays ary String answer = ""; answer "" for(int j=0; j<n; j++){
        	answer += ary[j];
        } int j=0; int j=0; j 0 j<n j n j++ j++ j {
        	answer += ary[j];
        } {
        	answer += ary[j];
        } answer += ary[j] answer ary[j] ary j 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 sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int l = sc.nextInt();
      
        String ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    }
} public class Main{

	public static void main(String args[]){
    	
      	Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int l = sc.nextInt();
      
        String ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{

	public static void main(String args[]){
    	
      	Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int l = sc.nextInt();
      
        String ary[] = new String[n];
      
      	for(int i=0; i<n; i++){
        	ary[i] = sc.next();
        }
      
      	Arrays.sort(ary);
      
      	String answer = "";
      	for(int j=0; j<n; j++){
        	answer += ary[j];
        }
      
      	System.out.println(answer);
        
    }
}