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