import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } 
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } 
} Main public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } main {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int L = scan.nextInt(); L scan.nextInt() scan.nextInt scan String[] str = new String[N]; str new String[N] N for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {  
        str[i] = scan.next();
      } {  
        str[i] = scan.next();
      } str[i] = scan.next() str[i] str i scan.next() scan.next scan Arrays.sort(str) Arrays.sort Arrays str for(String out : str){
        System.out.print(out);
      } String out str {
        System.out.print(out);
      } {
        System.out.print(out);
      } System.out.print(out) System.out.print System.out System System.out out scan.close() scan.close scan String[] args args public class Main {
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } 
} public class Main {
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } 
} Main
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int N = scan.nextInt();
      int L = scan.nextInt();
     
      String[] str = new String[N];
      
      for(int i = 0; i < N; i++){  
        str[i] = scan.next();
      }
      
      Arrays.sort(str);
      
      for(String out : str){
        System.out.print(out);
      }
      scan.close();    
    } 
}
