import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner 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();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  } 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 sc.nextLine() sc.nextLine sc String[] ss = new String[n]; ss new String[n] n for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    } int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
      ss[i] = sc.nextLine();
    } {
      ss[i] = sc.nextLine();
    } ss[i] = sc.nextLine() ss[i] ss i sc.nextLine() sc.nextLine sc Arrays.sort(ss) Arrays.sort Arrays ss StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String s : ss) {
      sb.append(s);
    } String s ss {
      sb.append(s);
    } {
      sb.append(s);
    } sb.append(s) sb.append sb s System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb 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();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  }
}
