function main(input) {
  const args = input.split('\n');
  const ary1 = args[0].split(' ').map(n => parseInt(n, 10));
  const N = ary1[0];
  const L = ary1[1];
  let ary2 = [];
  
  for (let i = 1; i <= L; i++) {
  	ary2.push(args[i]);
  }
  
  ary2 = ary2.sort((a, b) => {
  	a = a.toString().toLowerCase();
    b = b.toString().toLowerCase();
    if (a < b) {
      return -1;
    } else if (a > b) {
      return 1;
    }
    return 0;
  });
  
  console.log(ary2.join(''));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));