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> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	}
} 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> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//入力
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		//入力
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	} 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> SArray = new ArrayList<String>(); SArray new ArrayList<String>() for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			String S = sc.next();
			SArray.add(S);
		} {
			String S = sc.next();
			SArray.add(S);
		} String S = sc.next(); S sc.next() sc.next sc SArray.add(S) SArray.add SArray S Collections.sort(SArray) Collections.sort Collections SArray for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
		System.out.print(SArray.get(i));
		} {
		System.out.print(SArray.get(i));
		} System.out.print(SArray.get(i)) System.out.print System.out System System.out SArray.get(i) SArray.get SArray i 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> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	}
} 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> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	}
} 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> SArray = new ArrayList<String>();

		for (int i = 0; i < N; i++) {
			String S = sc.next();
			SArray.add(S);
		}

		Collections.sort(SArray);

		for (int i = 0; i < N; i++) {
		System.out.print(SArray.get(i));
		}
	}
}