import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.stream.Collectors; Collectors java.util.stream public class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  }
} Main public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  } main {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner final int l = scanner.nextInt(); l scanner.nextInt() scanner.nextInt scanner scanner.nextLine() scanner.nextLine scanner String[] s = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      s[i] = scanner.nextLine();
    } {
      s[i] = scanner.nextLine();
    } s[i] = scanner.nextLine() s[i] s i scanner.nextLine() scanner.nextLine scanner System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining())) System.out.println System.out System System.out Arrays.stream(s).sorted().collect(Collectors.joining()) Arrays.stream(s).sorted().collect Arrays.stream(s).sorted() Arrays.stream(s).sorted Arrays.stream(s) Arrays.stream Arrays s Collectors.joining() Collectors.joining Collectors String[] args args public class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  }
} public class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  }
} Main
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int n = scanner.nextInt();
    final int l = scanner.nextInt();
    scanner.nextLine();
    String[] s = new String[n];
    for (int i = 0; i < n; i++) {
      s[i] = scanner.nextLine();
    }

    System.out.println(Arrays.stream(s).sorted().collect(Collectors.joining()));
  }
}