function main (input) {
  let rowArr = input.split('\n');
  rowArr.shift();
  rowArr.sort();
  return rowArr.join('');
}

const input = `3 3
dxx
axx
cxx`;
// console.log(main(input));

console.log(main(require("fs").readFileSync("/dev/stdin","utf8")));

