import java.util.Arrays;
import java.util.Scanner;
//B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	}
} import java.util.Arrays; Arrays 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 = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int l = Integer.parseInt(sc.next()); l Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] ans = new String[n]; ans new String[n] n for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		} int i=0; int i=0; i 0 i< n i n i++ i++ i {
			ans[i] = sc.next();
		} {
			ans[i] = sc.next();
		} ans[i] = sc.next() ans[i] ans i sc.next() sc.next sc Arrays.sort(ans) Arrays.sort Arrays ans for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		} int i = 0; int i = 0; i 0 i < ans.length i ans.length ans ans.length i++ i++ i {
			System.out.print(ans[i]);
		} {
			System.out.print(ans[i]);
		} System.out.print(ans[i]) System.out.print System.out System System.out ans[i] ans i String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
//B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next()); //StringをIntに変換する
		int l = Integer.parseInt(sc.next());

		String[] ans = new String[n];
		for (int i=0; i< n; i++) {
			ans[i] = sc.next();
		}

		Arrays.sort(ans); //昇順で並べ替え

		for (int i = 0; i < ans.length; i++) {
			System.out.print(ans[i]);
		}
	}
}
