import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	}

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

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	} main {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int L = scanner.nextInt(); L scanner.nextInt() scanner.nextInt scanner ArrayList<String> S = new ArrayList<String>(); S new ArrayList<String>() for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			S.add(scanner.nextLine());
		} {
			S.add(scanner.nextLine());
		} S.add(scanner.nextLine()) S.add S scanner.nextLine() scanner.nextLine scanner scanner.close() scanner.close scanner Collections.sort(S) Collections.sort Collections S for(String str: S) {
			System.out.print(str);
		} String str S {
			System.out.print(str);
		} {
			System.out.print(str);
		} System.out.print(str) System.out.print System.out System System.out str System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		ArrayList<String> S = new ArrayList<String>();
		for(int i = 0; i <= N; i++) {
			S.add(scanner.nextLine());
		}
		scanner.close();

		Collections.sort(S);

		for(String str: S) {
			System.out.print(str);
		}

		System.out.println();

	}

}
