import java.util.*;
 
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  }	
} import java.util.*; util.* java public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  }	
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  } main {
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc String[] ln = str.split(" "); ln str.split(" ") str.split str " " int n = Integer.parseInt(ln[0]); n Integer.parseInt(ln[0]) Integer.parseInt Integer ln[0] ln 0 int l = Integer.parseInt(ln[1]); l Integer.parseInt(ln[1]) Integer.parseInt Integer ln[1] ln 1 List<String> strList = new ArrayList<String>(); strList new ArrayList<String>() for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
  		    strList.add(sc.nextLine());
	} {
  		    strList.add(sc.nextLine());
	} strList.add(sc.nextLine()) strList.add strList sc.nextLine() sc.nextLine sc Collections.sort(strList) Collections.sort Collections strList for(String str2 :strList){
	    System.out.print(str2);
    } String str2 strList {
	    System.out.print(str2);
    } {
	    System.out.print(str2);
    } System.out.print(str2) System.out.print System.out System System.out str2 String args[] args public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  }	
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  }	
} Main
import java.util.*;
 
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	String str = sc.nextLine();
    String[] ln = str.split(" ");
    int n = Integer.parseInt(ln[0]);
    int l = Integer.parseInt(ln[1]);
 
    List<String> strList = new ArrayList<String>(); 

    for(int i = 0; i < n; i++){
  		    strList.add(sc.nextLine());
	}
 
    Collections.sort(strList);
    
    for(String str2 :strList){
	    System.out.print(str2);
    }
  }	
}