#include <iostream>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
int main ()
{
    int n,m;
    cin>>n>>m;
    string a[110];
    for (int i=0;i<n;i++)
    	cin>>a[i];
    map<string, int> str;
    for (int i=0;i<n;i++)
    	str[a[i]]=1;
     map<string, int> ::iterator it;
     for (it =str.begin();it!=str.end();it++)
     	cout<<it->first;
    cout<<endl;
    return 0;
}