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 sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	}
} 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 sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	} main {
		Scanner sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		} {
			sc.close();
		} sc.close() sc.close sc {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				list.add(sc.nextLine());
			} {
				list.add(sc.nextLine());
			} list.add(sc.nextLine()) list.add list sc.nextLine() sc.nextLine sc Collections.sort(list) Collections.sort Collections list for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				System.out.print(list.get(i));
			} {
				System.out.print(list.get(i));
			} System.out.print(list.get(i)) System.out.print System.out System System.out list.get(i) list.get list i System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	}
} 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 sc = new Scanner(System.in);
		try {
			int n = sc.nextInt();
			// L
			sc.nextInt();
			sc.nextLine();

			List<String> list = new ArrayList<String>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextLine());
			}
			Collections.sort(list);

			for (int i = 0; i < n; i++) {
				System.out.print(list.get(i));
			}
			System.out.println();

		} finally {
			sc.close();
		}
	}
}