import java.util.*;

class Main{
  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] array = new String[N];
      
      for(int i = 0 ; i < N ; i++){
        array[i] = sc.next();
      }

      Arrays.sort(array);

      for (int j = 0 ; j < array.length ; j++){
        System.out.print(array[j]);

      }
      sc.close();
    }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] array = new String[N];
      
      for(int i = 0 ; i < N ; i++){
        array[i] = sc.next();
      }

      Arrays.sort(array);

      for (int j = 0 ; j < array.length ; j++){
        System.out.print(array[j]);

      }
      sc.close();
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] array = new String[N];
      
      for(int i = 0 ; i < N ; i++){
        array[i] = sc.next();
      }

      Arrays.sort(array);

      for (int j = 0 ; j < array.length ; j++){
        System.out.print(array[j]);

      }
      sc.close();
    } main {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] array = new String[N];
      
      for(int i = 0 ; i < N ; i++){
        array[i] = sc.next();
      }

      Arrays.sort(array);

      for (int j = 0 ; j < array.length ; j++){
        System.out.print(array[j]);

      }
      sc.close();
    } 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[] array = new String[N]; array new String[N] N for(int i = 0 ; i < N ; i++){
        array[i] = sc.next();
      } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
        array[i] = sc.next();
      } {
        array[i] = sc.next();
      } array[i] = sc.next() array[i] array i sc.next() sc.next sc Arrays.sort(array) Arrays.sort Arrays array for (int j = 0 ; j < array.length ; j++){
        System.out.print(array[j]);

      } int j = 0 ; int j = 0 ; j 0 j < array.length j array.length array array.length j++ j++ j {
        System.out.print(array[j]);

      } {
        System.out.print(array[j]);

      } System.out.print(array[j]) System.out.print System.out System System.out array[j] array j sc.close() sc.close sc String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] array = new String[N];
      
      for(int i = 0 ; i < N ; i++){
        array[i] = sc.next();
      }

      Arrays.sort(array);

      for (int j = 0 ; j < array.length ; j++){
        System.out.print(array[j]);

      }
      sc.close();
    }
}
