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();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  }

} 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();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int L = sc.nextInt();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  } main {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int L = sc.nextInt();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  } 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 TreeMap<String, Integer> hashMap = new TreeMap<>(); hashMap new TreeMap<>() for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    } {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    } String s_ = sc.next(); s_ sc.next() sc.next sc if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      } hashMap.containsKey(s_) hashMap.containsKey hashMap s_ {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } Integer v_ = hashMap.get(s_); v_ hashMap.get(s_) hashMap.get hashMap s_ hashMap.put(s_,v_ + 1) hashMap.put hashMap s_ v_ + 1 v_ 1 { 
        hashMap.put(s_,1);
      } hashMap.put(s_,1) hashMap.put hashMap s_ 1 sc.close() sc.close sc for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    } Map.Entry<String, Integer> map hashMap.entrySet() hashMap.entrySet hashMap {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    } {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    } for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      } int i = 0; int i = 0; i 0 i < map.getValue() i map.getValue() map.getValue map i++ i++ i {
        System.out.print(map.getKey());
      } {
        System.out.print(map.getKey());
      } System.out.print(map.getKey()) System.out.print System.out System System.out map.getKey() map.getKey map System.out.println("") System.out.println System.out System System.out "" 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();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int L = sc.nextInt();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  }

} 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();

    TreeMap<String, Integer> hashMap = new TreeMap<>();

    for (int i = 0; i < N; i++) {
      String s_ = sc.next();
      if (hashMap.containsKey(s_)) {
        Integer v_ = hashMap.get(s_);
        hashMap.put(s_,v_ + 1);
      } else { 
        hashMap.put(s_,1);
      }
    }

    sc.close();

    for (Map.Entry<String, Integer> map : hashMap.entrySet()) {
      for (int i = 0; i < map.getValue(); i++) {
        System.out.print(map.getKey());
      }
    }

    System.out.println("");

  }

}