function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.split(" ");
	input = input.split("\n");
	//input = input.split(" ").map((a)=>Number(a));
	//input = input.split("\n").map((a)=>Number(a));
  input.shift();
  input.sort(function(a,b){
  	var aList = a.split("");
    var bList = b.split("");
    for(var i = 0; i < aList.length; i++){
      if(aList[i] != bList[i]){
         return aList[i].charCodeAt() - bList[i].charCodeAt();
      }
    }
  });
  myout(input.join(""));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());