

import java.util.*;
public class Main {
    
public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

}
} import java.util.*; util.* java public class Main {
    
public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

}
} Main public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

} main {
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

} Scanner input = new Scanner (System.in); input new Scanner (System.in) int n = input.nextInt(); n input.nextInt() input.nextInt input int l = input.nextInt(); l input.nextInt() input.nextInt input String [] arr = new String [n]; arr new String [n] n for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
        arr[i]=input.next();
    } {
        arr[i]=input.next();
    } arr[i]=input.next() arr[i] arr i input.next() input.next input Arrays.sort(arr) Arrays.sort Arrays arr for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
        System.out.print(arr[i]);
    } {
        System.out.print(arr[i]);
    } System.out.print(arr[i]) System.out.print System.out System System.out arr[i] arr i System.out.println() System.out.println System.out System System.out String[]args args public class Main {
    
public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

}
} public class Main {
    
public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

}
} Main


import java.util.*;
public class Main {
    
public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

}
}