import 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();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  }
}

       import java.util.*; util.* java public class Main{
  
  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  }
} Main public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  } main {

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  } 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 List<String> array = new ArrayList<String>(); array new ArrayList<String>() for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      String tmp = sc.next();
      array.add(tmp);
    } {
      String tmp = sc.next();
      array.add(tmp);
    } String tmp = sc.next(); tmp sc.next() sc.next sc array.add(tmp) array.add array tmp Collections.sort(array) Collections.sort Collections array String output = ""; output "" for(int i=0;i<N;i++){
      output += array.get(i);
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      output += array.get(i);
    } {
      output += array.get(i);
    } output += array.get(i) output array.get(i) array.get array i System.out.println(output) System.out.println System.out System System.out output 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();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  }
} public class Main{
  
  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  }
} Main
import 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();
    List<String> array = new ArrayList<String>();
        
    for(int i=0;i<N;i++){
      String tmp = sc.next();
      array.add(tmp);
    }
    
    Collections.sort(array);
    
    String output = "";
    
    for(int i=0;i<N;i++){
      output += array.get(i);
    }
    
    System.out.println(output);
  }
}

      