import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  }
} Main public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  } main {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  } 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> strList = new ArrayList<String>(); strList new ArrayList<String>() for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    } {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    } String str = sc.next(); str sc.next() sc.next sc boolean inserted = false; inserted false for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      } int j = 0; int j = 0; j 0 j < strList.size() j strList.size() strList.size strList j++ j++ j {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      } {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      } if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        } str.compareTo(strList.get(j)) < 0 str.compareTo(strList.get(j)) str.compareTo str strList.get(j) strList.get strList j 0 {
          strList.add(j, str);
          inserted = true;
          break;
        } strList.add(j, str) strList.add strList j str inserted = true inserted true break; if (!inserted) {
        strList.add(str);
      } !inserted inserted {
        strList.add(str);
      } strList.add(str) strList.add strList str for (String s : strList) {
      System.out.print(s);
    } String s strList {
      System.out.print(s);
    } {
      System.out.print(s);
    } System.out.print(s) System.out.print System.out System System.out s String[] args args public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  }
} public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();

    List<String> strList = new ArrayList<String>();

    for (int i = 0; i < n; i++) {
      String str = sc.next();
      boolean inserted = false;
      for (int j = 0; j < strList.size(); j++) {
        if (str.compareTo(strList.get(j)) < 0) {
          strList.add(j, str);
          inserted = true;
          break;
        }
      }
      if (!inserted) {
        strList.add(str);
      }
    }

    for (String s : strList) {
      System.out.print(s);
    }
  }
}
