#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int n,l;
    while(cin>>n>>l)
    {
        string s[105];
        int a[105];
        for(int i = 0 ; i < n ; i++ )
        {
            cin>>s[i];
            a[i] = (int)s[i][0];
        }
        sort(s+0,s+n);
        for(int j=0;j<n;j++ )
        cout<<s[j];
        }
}