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

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int length = sc.nextInt(); length sc.nextInt() sc.nextInt sc String[] str = new String[num]; str new String[num] num for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			str[i] = sc.next();
		} {
			str[i] = sc.next();
		} str[i] = sc.next() str[i] str i sc.next() sc.next sc Arrays.sort(str) Arrays.sort Arrays str for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			System.out.print(str[i]);
		} {
			System.out.print(str[i]);
		} System.out.print(str[i]) System.out.print System.out System System.out str[i] str i String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	}
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int length = sc.nextInt();
		String[] str = new String[num];
		for (int i = 0; i < num; i++) {
			str[i] = sc.next();
		}

		Arrays.sort(str);
		for (int i = 0; i < num; i++) {
			System.out.print(str[i]);
		}
	}
}
