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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	} 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 scanner.nextLine() scanner.nextLine scanner String[] lines = new String[n]; lines new String[n] n for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			lines[i] = scanner.nextLine();
		} {
			lines[i] = scanner.nextLine();
		} lines[i] = scanner.nextLine() lines[i] lines i scanner.nextLine() scanner.nextLine scanner Arrays.sort(lines) Arrays.sort Arrays lines String result = String.join("", lines); result String.join("", lines) String.join String "" lines System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int l = scanner.nextInt();
		scanner.nextLine();
		String[] lines = new String[n];
		for (int i = 0; i < n; i++) {
			lines[i] = scanner.nextLine();
		}
		Arrays.sort(lines);
		String result = String.join("", lines);
		System.out.println(result);
	}
}
