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