import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int l = scanner.nextInt();
		List<String> list = new ArrayList<>();

		for(int i=0; i<n;i++) {
			list.add(scanner.next());
		}

		Collections.sort(list);

		for(String str :list) {
			System.out.print(str);
		}

	}
} 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 class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int l = scanner.nextInt();
		List<String> list = new ArrayList<>();

		for(int i=0; i<n;i++) {
			list.add(scanner.next());
		}

		Collections.sort(list);

		for(String str :list) {
			System.out.print(str);
		}

	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int l = scanner.nextInt();
		List<String> list = new ArrayList<>();

		for(int i=0; i<n;i++) {
			list.add(scanner.next());
		}

		Collections.sort(list);

		for(String str :list) {
			System.out.print(str);
		}

	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int l = scanner.nextInt();
		List<String> list = new ArrayList<>();

		for(int i=0; i<n;i++) {
			list.add(scanner.next());
		}

		Collections.sort(list);

		for(String str :list) {
			System.out.print(str);
		}

	} 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 List<String> list = new ArrayList<>(); list new ArrayList<>() for(int i=0; i<n;i++) {
			list.add(scanner.next());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			list.add(scanner.next());
		} {
			list.add(scanner.next());
		} list.add(scanner.next()) list.add list scanner.next() scanner.next scanner Collections.sort(list) Collections.sort Collections list for(String str :list) {
			System.out.print(str);
		} String str list {
			System.out.print(str);
		} {
			System.out.print(str);
		} System.out.print(str) System.out.print System.out System System.out str String args[] args
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int l = scanner.nextInt();
		List<String> list = new ArrayList<>();

		for(int i=0; i<n;i++) {
			list.add(scanner.next());
		}

		Collections.sort(list);

		for(String str :list) {
			System.out.print(str);
		}

	}
}