import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	}
}
 import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	} main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	} 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 String target = ""; target "" List<String> stringList = new ArrayList<>(); stringList new ArrayList<>() for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		} {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		} String inputStr = scanner.nextLine(); inputStr scanner.nextLine() scanner.nextLine scanner stringList.add(inputStr) stringList.add stringList inputStr Collections.sort(stringList) Collections.sort Collections stringList for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			target += stringList.get(i);
		} {
			target += stringList.get(i);
		} target += stringList.get(i) target stringList.get(i) stringList.get stringList i System.out.println(target) System.out.println System.out System System.out target 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();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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();
		String target = "";
		List<String> stringList = new ArrayList<>();
		for (int i = 0; i <= N; i++) {
			String inputStr = scanner.nextLine();
			stringList.add(inputStr);
		}
		Collections.sort(stringList);
		for (int i = 0; i <= N; i++) {
			target += stringList.get(i);
		}
		System.out.println(target);
	}
}

