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) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	}

	private static String concatStringOrderbyAsc(List<String> strings) {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	}
} 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) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	}

	private static String concatStringOrderbyAsc(List<String> strings) {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		} {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int L = scanner.nextInt(); L scanner.nextInt() scanner.nextInt scanner List<String> strings = new ArrayList<String>(); strings new ArrayList<String>() for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				strings.add(scanner.next());
			} {
				strings.add(scanner.next());
			} strings.add(scanner.next()) strings.add strings scanner.next() scanner.next scanner System.out.println(concatStringOrderbyAsc(strings)) System.out.println System.out System System.out concatStringOrderbyAsc(strings) concatStringOrderbyAsc strings String[] args args private static String concatStringOrderbyAsc(List<String> strings) {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	} concatStringOrderbyAsc {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() Collections.sort(strings) Collections.sort Collections strings for (String s : strings) {
			sb.append(s);
		} String s strings {
			sb.append(s);
		} {
			sb.append(s);
		} sb.append(s) sb.append sb s return sb.toString(); sb.toString() sb.toString sb List<String> strings strings public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	}

	private static String concatStringOrderbyAsc(List<String> strings) {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	}

	private static String concatStringOrderbyAsc(List<String> strings) {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	}
} 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) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			int L = scanner.nextInt();
			// input
			List<String> strings = new ArrayList<String>();
			for (int i = 0; i < N; i++) {
				strings.add(scanner.next());
			}
			// sort・concat
			System.out.println(concatStringOrderbyAsc(strings));
		}
	}

	private static String concatStringOrderbyAsc(List<String> strings) {
		StringBuilder sb = new StringBuilder();
		Collections.sort(strings);

		for (String s : strings) {
			sb.append(s);
		}

		return sb.toString();
	}
}