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 scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	}
} 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 scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int l = scan.nextInt(); l scan.nextInt() scan.nextInt scan List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int i = 0; i < n; i++) {
			list.add(scan.next());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list.add(scan.next());
		} {
			list.add(scan.next());
		} list.add(scan.next()) list.add list scan.next() scan.next scan Collections.sort(list) Collections.sort Collections list for (String s : list) {
			System.out.print(s);
		} String s list {
			System.out.print(s);
		} {
			System.out.print(s);
		} System.out.print(s) System.out.print System.out System System.out s System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	}
} 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 scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			list.add(scan.next());
		}
		Collections.sort(list);
		for (String s : list) {
			System.out.print(s);
		}
		System.out.println();
	}
}