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> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    }
} 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> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    List<String> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    List<String> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    } 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> list = new ArrayList<String>(); list new ArrayList<String>() for(int i = 0; i<n; i++){
      list.add(sc.next());
    } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
      list.add(sc.next());
    } {
      list.add(sc.next());
    } list.add(sc.next()) list.add list sc.next() sc.next sc Collections.sort(list) Collections.sort Collections list for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    } int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i {
      System.out.print(list.get(i));
    } {
      System.out.print(list.get(i));
    } System.out.print(list.get(i)) System.out.print System.out System System.out list.get(i) list.get list i 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> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    }
} 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> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    }
} 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> list = new ArrayList<String>();
    for(int i = 0; i<n; i++){
      list.add(sc.next());
    }
    
    Collections.sort(list);
    for(int i=0; i<list.size(); i++){
      System.out.print(list.get(i));
    }
    }
}