include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
while (t–)
{
cin.get();
string str[100];
int n;
cin>>n;
for (int i = 0; i <n; i++)
{
cin >> str[i];
}
sort(str,str+n);
reverse(str,str+n);
for (int i = 0; i <n ; i++) {
cout << str[i];
}
cout<< endl;
}
}