import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	}
} import java.io.IOException; IOException java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	}
} Main public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	} main {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	} try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		} {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		} Scanner s = new Scanner(System.in) Scanner s = new Scanner(System.in) new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int l = s.nextInt(); l s.nextInt() s.nextInt s String[] array = new String[n]; array new String[n] n for (int i = 0; i < n; i++) {
				array[i] = s.next();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				array[i] = s.next();
			} {
				array[i] = s.next();
			} array[i] = s.next() array[i] array i s.next() s.next s Arrays.sort(array) Arrays.sort Arrays array StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String str : array) {
				sb.append(str);
			} String str array {
				sb.append(str);
			} {
				sb.append(str);
			} sb.append(str) sb.append sb str System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	}
} Main
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			int n = s.nextInt();
			int l = s.nextInt();
			String[] array = new String[n];
			for (int i = 0; i < n; i++) {
				array[i] = s.next();
			}
			Arrays.sort(array);
			StringBuilder sb = new StringBuilder();
			for (String str : array) {
				sb.append(str);
			}
			System.out.println(sb);
		}
	}
}
