import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    long n, l;
    scan(n, l);
    auto tmp = new string[](n);
    foreach (i; 0 .. n)
    {
        string s;
        s = sread();
        tmp[i] = s;
    }
    // writeln(tmp);
    auto tmp_sort = tmp.sort();
    foreach (i; 0 .. n)
    {
        write(tmp_sort[i]);
    }
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
