"use strict"
const assert = require('assert');

function main(input) {
    let ret = check(input);
    console.log(ret);
}

function check(input) {
    let [n, array] = input.split(" ");
    let ls = array.split("\n");
    let l = ls[0];
    l = parseInt(l);
    let s = ls.slice(1, n + 1);
    s.sort(function (a, b) {
        return (a < b ? -1 : 1);
    });
    let ans = (s.join(""));
    return ans;
}

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

// check
// var answer;

// input = `3 3
// dxx
// axx
// cxx`;
// answer = "axxcxxdxx";
// assert.equal(check(input), answer);