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