function Main(input) {
	var tmp = input.split("\n");
	var N = parseInt(tmp[0].split(" ")[0], 10);
	var L = parseInt(tmp[0].split(" ")[1], 10);
	var stringAry = [];
	for (var i = 1; i <= N; i++) {
		stringAry.push(tmp[i]);
	}
	var sortedAry = stringAry.sort();
	var ans = sortedAry.join("");
	console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));process.stdin.resume();