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);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		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);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		sc.close();
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc List<String> sList = new ArrayList<String>(); sList new ArrayList<String>() for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			sList.add(sc.next());
		} {
			sList.add(sc.next());
		} sList.add(sc.next()) sList.add sList sc.next() sc.next sc Collections.sort(sList) Collections.sort Collections sList int listSize = sList.size(); listSize sList.size() sList.size sList StringBuilder sss = new StringBuilder(); sss new StringBuilder() for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		} int i = 0; int i = 0; i 0 i < listSize i listSize i++ i++ i {
			sss.append(sList.get(i));
		} {
			sss.append(sList.get(i));
		} sss.append(sList.get(i)) sss.append sss sList.get(i) sList.get sList i System.out.println(sss) System.out.println System.out System System.out sss sc.close() sc.close sc String args[] args public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		sc.close();
	}
} public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		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);
		int n = sc.nextInt();
		int l = sc.nextInt();
		List<String> sList = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			sList.add(sc.next());
		}
		Collections.sort(sList);

		int listSize = sList.size();

		StringBuilder sss = new StringBuilder();
		for (int i = 0; i < listSize; i++) {
			sss.append(sList.get(i));
		}
		System.out.println(sss);
		sc.close();
	}
}
