stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <cstdlib>

#include <cstdio>

#include <algorithm>

#include <iostream>

#pragma GCC optimize(2)

using namespace std;

string s1[10005];

bool cmp(string a,string b){

	return a<b;

}

void print(){

	int n,l;

	cin>>n>>l;

	

	int i;

	for(i=0;i<n;i++)

		cin>>s1[i];

	sort(s1,s1+n,cmp);

	for(i=0;i<n;i++)

	    cout<<s1[i];

}

int main(void){

	ios::sync_with_stdio(false);

	print();

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.354793078549974x):
#include<bits/stdc++.h>//我爱万能头 

using namespace std;

string a[101];int n,i;

int main(){

    scanf("%d%*d",&n);//sao操作所在地 

    for(i=0;i<n;i++)

        cin>>a[i];

    sort(a,a+n);//虽然会其他排序方法但懒得打QwQ 

    for(i=0;i<n;i++)

        cout<<a[i];

    return 0;

}
// Slower C++ solution:
#include <cstdlib>

#include <cstdio>

#include <algorithm>

#include <iostream>

#pragma GCC optimize(2)

using namespace std;

string s1[10005];

bool cmp(string a,string b){

	return a<b;

}

void print(){

	int n,l;

	cin>>n>>l;

	

	int i;

	for(i=0;i<n;i++)

		cin>>s1[i];

	sort(s1,s1+n,cmp);

	for(i=0;i<n;i++)

	    cout<<s1[i];

}

int main(void){

	ios::sync_with_stdio(false);

	print();

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.3391937730348855x):
#include<bits/stdc++.h>

using namespace std;

string a[101];

int n,i;

int main(){

    scanf("%d%*d",&n);

    for(i=0;i<n;i++)

        cin>>a[i];

    sort(a,a+n);

    for(i=0;i<n;i++)    cout<<a[i];

    cout<<endl;

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstdio>

#include <algorithm>



using namespace std;



const int maxn=110;

string all[maxn];

bool cmp(string str1,string str2);



int main()

{

    int n,l;

    scanf("%d %d",&n,&l);

    for(int i=0;i<n;i++)

        cin>>all[i];

    sort(all,all+n,cmp);

    string ans;

    for(int i=0;i<n;i++)

        ans+=all[i];

    cout<<ans<<endl;

    return 0;

}



bool cmp(string str1,string str2)

{

    return str1+str2<str2+str1;

}


// Faster C++ solution for the same problem (measured speedup: 5.052669654237274x):
#include<cstdio>

#include<cstring>



using namespace std;



int main()

{

    char str[110][110];

    char ch[20000];

    int n, m, len = 0;

    scanf("%d%d", &n, &m);

    for(int i = 0; i < n; i++)

        scanf("%s", str[i]);

    for(int i = 0; i < n; i++)

        for(int j = 0; j < n; j++)

        {

            if(strcmp(str[i], str[j]) < 0)

            {

                char str1[110];

                strcpy(str1, str[i]);

                strcpy(str[i], str[j]);

                strcpy(str[j], str1);

            }

        }

    for(int i = 0; i < n; i++)

    {

        len += strlen(str[i]);

        strcat(ch, str[i]);

    }

    ch[len] = '\0';

    printf("%s", ch);

    return 0;

}
// Slower C++ solution:
#include<vector>

#include<list>

#include<map>

#include<set>

#include<deque>

#include<stack>

#include<bitset>

#include<algorithm>

#include<functional>

#include<numeric>

#include<utility>

#include<sstream>

#include<iostream>

#include<iomanip>

#include<cstdio>

#include<cmath>

#include<cstdlib>

#include<cstring>

#include<ctime>

#include<queue>

using namespace std;

const int INF=0x3f3f3f3f;

char a[1000][1000];

int n,m;

int main()

{

    int n,l;

    while(scanf("%d%d",&n,&l)!=EOF)

    {

        for(int i=1;i<=n;i++)

            scanf("%s",a[i]);

        for(int i=1;i<=n;i++)

        {

            for(int j=i+1;j<=n;j++)

            {

                if(strcmp(a[i],a[j])>0)

                {

                    char s[1000];

                    strcpy(s,a[i]);

                    strcpy(a[i],a[j]);

                    strcpy(a[j],s);

                }

            }

        }

        for(int i=1;i<=n;i++)

        {

            printf("%s",a[i]);

        }

        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.965014858022581x):
#include<cstdio>

#include<cstring>



using namespace std;



int main()

{

    char str[110][110];

    char ch[20000];

    int n, m, len = 0;

    scanf("%d%d", &n, &m);

    for(int i = 0; i < n; i++)

        scanf("%s", str[i]);

    for(int i = 0; i < n; i++)

        for(int j = 0; j < n; j++)

        {

            if(strcmp(str[i], str[j]) < 0)

            {

                char str1[110];

                strcpy(str1, str[i]);

                strcpy(str[i], str[j]);

                strcpy(str[j], str1);

            }

        }

    for(int i = 0; i < n; i++)

    {

        len += strlen(str[i]);

        strcat(ch, str[i]);

    }

    ch[len] = '\0';

    printf("%s", ch);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstdio>

#include <algorithm>



using namespace std;



const int maxn=110;

string all[maxn];

bool cmp(string str1,string str2);



int main()

{

    int n,l;

    scanf("%d %d",&n,&l);

    for(int i=0;i<n;i++)

        cin>>all[i];

    sort(all,all+n,cmp);

    string ans;

    for(int i=0;i<n;i++)

        ans+=all[i];

    cout<<ans<<endl;

    return 0;

}



bool cmp(string str1,string str2)

{

    return str1+str2<str2+str1;

}


// Faster C++ solution for the same problem (measured speedup: 5.276413397574602x):
#include <cstdio>

#include <cstring>



using namespace std;





struct node

{

    char ch[110];

}c[110];

int main()

{

    int n, l;

    while(scanf("%d%d",&n, &l) != EOF)

    {

        for(int i = 0;i < n;i++)

        {

            scanf("%s",c[i].ch);

        }

        node e;

        for(int i = 0;i < n-1;i++)

        {

            for(int j = i+1;j < n;j++)

            {

                if(strcmp(c[i].ch,c[j].ch) > 0)

                {

                    e = c[i];

                    c[i] = c[j];

                    c[j] = e;

                }

            }

        }

        for(int i = 0;i < n;i++)

        {

            printf("%s",c[i].ch);

        }

        printf("\n");

    }

    return 0;

}
// Slower C++ solution:
#include<vector>

#include<list>

#include<map>

#include<set>

#include<deque>

#include<stack>

#include<bitset>

#include<algorithm>

#include<functional>

#include<numeric>

#include<utility>

#include<sstream>

#include<iostream>

#include<iomanip>

#include<cstdio>

#include<cmath>

#include<cstdlib>

#include<cstring>

#include<ctime>

#include<queue>

using namespace std;

const int INF=0x3f3f3f3f;

char a[1000][1000];

int n,m;

int main()

{

    int n,l;

    while(scanf("%d%d",&n,&l)!=EOF)

    {

        for(int i=1;i<=n;i++)

            scanf("%s",a[i]);

        for(int i=1;i<=n;i++)

        {

            for(int j=i+1;j<=n;j++)

            {

                if(strcmp(a[i],a[j])>0)

                {

                    char s[1000];

                    strcpy(s,a[i]);

                    strcpy(a[i],a[j]);

                    strcpy(a[j],s);

                }

            }

        }

        for(int i=1;i<=n;i++)

        {

            printf("%s",a[i]);

        }

        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.184877046940436x):
#include <cstdio>

#include <cstring>



using namespace std;





struct node

{

    char ch[110];

}c[110];

int main()

{

    int n, l;

    while(scanf("%d%d",&n, &l) != EOF)

    {

        for(int i = 0;i < n;i++)

        {

            scanf("%s",c[i].ch);

        }

        node e;

        for(int i = 0;i < n-1;i++)

        {

            for(int j = i+1;j < n;j++)

            {

                if(strcmp(c[i].ch,c[j].ch) > 0)

                {

                    e = c[i];

                    c[i] = c[j];

                    c[j] = e;

                }

            }

        }

        for(int i = 0;i < n;i++)

        {

            printf("%s",c[i].ch);

        }

        printf("\n");

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstdio>

#include <algorithm>



using namespace std;



const int maxn=110;

string all[maxn];

bool cmp(string str1,string str2);



int main()

{

    int n,l;

    scanf("%d %d",&n,&l);

    for(int i=0;i<n;i++)

        cin>>all[i];

    sort(all,all+n,cmp);

    string ans;

    for(int i=0;i<n;i++)

        ans+=all[i];

    cout<<ans<<endl;

    return 0;

}



bool cmp(string str1,string str2)

{

    return str1+str2<str2+str1;

}


// Faster C++ solution for the same problem (measured speedup: 5.288203272799525x):
#include<stdio.h>

#include<string.h>

    char h[105][105];

    char q[105]={"0"};

    char w[10005];

int main()

{

	int i;

	int k;

	int p;

	int a;

	int b;

	       scanf("%d%d",&a,&b);

	   	  for(i=0;i<a;i++){

	   	  	   scanf("%s",h[i]);}

	      for(i=0;i<a-1;i++){

	      for(k=0;k<a-1-i;k++){

	      	  p=strcmp(h[k],h[k+1]);

				 if(p>0){

				 	strcpy(q,h[k]);

				 	strcpy(h[k],h[k+1]);

				 	strcpy(h[k+1],q);

				 }

	      	

		  }

	}

		  

		  

		  strcpy(w,h[0]);

		  for(i=1;i<a;i++)

		  	 strcat(w,h[i]);

			   printf("%s",w);

	return 0;	  

		  

}
// Slower C++ solution:
#include<vector>

#include<list>

#include<map>

#include<set>

#include<deque>

#include<stack>

#include<bitset>

#include<algorithm>

#include<functional>

#include<numeric>

#include<utility>

#include<sstream>

#include<iostream>

#include<iomanip>

#include<cstdio>

#include<cmath>

#include<cstdlib>

#include<cstring>

#include<ctime>

#include<queue>

using namespace std;

const int INF=0x3f3f3f3f;

char a[1000][1000];

int n,m;

int main()

{

    int n,l;

    while(scanf("%d%d",&n,&l)!=EOF)

    {

        for(int i=1;i<=n;i++)

            scanf("%s",a[i]);

        for(int i=1;i<=n;i++)

        {

            for(int j=i+1;j<=n;j++)

            {

                if(strcmp(a[i],a[j])>0)

                {

                    char s[1000];

                    strcpy(s,a[i]);

                    strcpy(a[i],a[j]);

                    strcpy(a[j],s);

                }

            }

        }

        for(int i=1;i<=n;i++)

        {

            printf("%s",a[i]);

        }

        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.196462388882766x):
#include<stdio.h>

#include<string.h>

    char h[105][105];

    char q[105]={"0"};

    char w[10005];

int main()

{

	int i;

	int k;

	int p;

	int a;

	int b;

	       scanf("%d%d",&a,&b);

	   	  for(i=0;i<a;i++){

	   	  	   scanf("%s",h[i]);}

	      for(i=0;i<a-1;i++){

	      for(k=0;k<a-1-i;k++){

	      	  p=strcmp(h[k],h[k+1]);

				 if(p>0){

				 	strcpy(q,h[k]);

				 	strcpy(h[k],h[k+1]);

				 	strcpy(h[k+1],q);

				 }

	      	

		  }

	}

		  

		  

		  strcpy(w,h[0]);

		  for(i=1;i<a;i++)

		  	 strcat(w,h[i]);

			   printf("%s",w);

	return 0;	  

		  

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<algorithm>

#include<cmath>

#include<map>

#include<vector>

#include<string.h>

#include<set>

#define inf 0x3f3f3f3f

using namespace std;

map<string,int>mp;

map<string,int>::iterator it;

int main()

{

    int n,l;

    cin>>n>>l;

    for(int i=0; i<n; i++)

    {

        string s;

        cin>>s;

        mp[s]++;

    }

    for(it=mp.begin(); it!=mp.end(); )

    {

        cout<<it->first;

        it->second--;

        if(it->second==0)

            it++;

    }

    puts("");

}


// Faster C++ solution for the same problem (measured speedup: 5.264057510470937x):
#include<stdio.h>

#include<string.h>

    char h[105][105];

    char q[105]={"0"};

    char w[10005];

int main()

{

	int i;

	int k;

	int p;

	int a;

	int b;

	       scanf("%d%d",&a,&b);

	   	  for(i=0;i<a;i++){

	   	  	   scanf("%s",h[i]);}

	      for(i=0;i<a-1;i++){

	      for(k=0;k<a-1-i;k++){

	      	  p=strcmp(h[k],h[k+1]);

				 if(p>0){

				 	strcpy(q,h[k]);

				 	strcpy(h[k],h[k+1]);

				 	strcpy(h[k+1],q);

				 }

	      	

		  }

	}

		  

		  

		  strcpy(w,h[0]);

		  for(i=1;i<a;i++)

		  	 strcat(w,h[i]);

			   printf("%s",w);

	return 0;	  

		  

}
// Slower C++ solution:
#include<string>

#include<stdio.h>

#include<vector>

#include<set>

#include<map>

#include<queue>

#include <iomanip>

#include<cmath>

#include<stack>

#include <algorithm>

#include<cstdio>

#include <cstring>

#include <iostream>

#define inf 0n7fffffff

using namespace std;

int main()

{

    string ch[1010];

    int n,d;

    cin>>n>>d;

    for(int i=1;i<=n;i++)

        cin>>ch[i];

    sort (ch+1,ch+n+1);

    for(int i=1;i<=n;i++)

        cout<<ch[i];

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.408257172574856x):
#include<stdio.h>

#include<string.h>

    char h[105][105];

    char q[105]={"0"};

    char w[10005];

int main()

{

	int i;

	int k;

	int p;

	int a;

	int b;

	       scanf("%d%d",&a,&b);

	   	  for(i=0;i<a;i++){

	   	  	   scanf("%s",h[i]);}

	      for(i=0;i<a-1;i++){

	      for(k=0;k<a-1-i;k++){

	      	  p=strcmp(h[k],h[k+1]);

				 if(p>0){

				 	strcpy(q,h[k]);

				 	strcpy(h[k],h[k+1]);

				 	strcpy(h[k+1],q);

				 }

	      	

		  }

	}

		  

		  

		  strcpy(w,h[0]);

		  for(i=1;i<a;i++)

		  	 strcat(w,h[i]);

			   printf("%s",w);

	return 0;	  

		  

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cmath>

#include<cstring>

#include<algorithm>

using namespace std;

typedef long long ll;

const int maxn=1e5+10;

string s[100];

int main()

{

    int n,m;

    scanf("%d%d",&n,&m);

    getchar();

    for(int i=0;i<n;i++)

    {

        cin>>s[i];

    }

    sort(s,s+n);

    for(int i=0;i<n;i++)

        cout<<s[i];

    printf("\n");

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.260988553535882x):
#include<stdio.h>

#include<string.h>

    char h[105][105];

    char q[105]={"0"};

    char w[10005];

int main()

{

	int i;

	int k;

	int p;

	int a;

	int b;

	       scanf("%d%d",&a,&b);

	   	  for(i=0;i<a;i++){

	   	  	   scanf("%s",h[i]);}

	      for(i=0;i<a-1;i++){

	      for(k=0;k<a-1-i;k++){

	      	  p=strcmp(h[k],h[k+1]);

				 if(p>0){

				 	strcpy(q,h[k]);

				 	strcpy(h[k],h[k+1]);

				 	strcpy(h[k+1],q);

				 }

	      	

		  }

	}

		  

		  

		  strcpy(w,h[0]);

		  for(i=1;i<a;i++)

		  	 strcat(w,h[i]);

			   printf("%s",w);

	return 0;	  

		  

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<string>

#include<algorithm>

using namespace std;



string s[105];



int main(){

	int n,m;cin >> n >> m;

	for(int i = 1 ; i <= n ; i++)

		cin >> s[i];

	sort(s+1,s+1+n);

	for(int i = 1 ; i <= n ; i++)cout << s[i];

}

// Faster C++ solution for the same problem (measured speedup: 5.2446467490592275x):
#include<stdio.h>

#include<string.h>

    char h[105][105];

    char q[105]={"0"};

    char w[10005];

int main()

{

	int i;

	int k;

	int p;

	int a;

	int b;

	       scanf("%d%d",&a,&b);

	   	  for(i=0;i<a;i++){

	   	  	   scanf("%s",h[i]);}

	      for(i=0;i<a-1;i++){

	      for(k=0;k<a-1-i;k++){

	      	  p=strcmp(h[k],h[k+1]);

				 if(p>0){

				 	strcpy(q,h[k]);

				 	strcpy(h[k],h[k+1]);

				 	strcpy(h[k+1],q);

				 }

	      	

		  }

	}

		  

		  

		  strcpy(w,h[0]);

		  for(i=1;i<a;i++)

		  	 strcat(w,h[i]);

			   printf("%s",w);

	return 0;	  

		  

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    string aarr[105];

    int n,l;

    cin>>n>>l;

    for(int i=0;i<n;i++)

    {

        cin>>aarr[i];

    }

    sort(aarr,aarr+n);

    for(int i=0;i<n;i++)

    {

        cout<<aarr[i];

    }

}










// Faster C++ solution for the same problem (measured speedup: 3.519209145854706x):
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

int main(){

	

	int n, l;

	cin>>n>>l;

	string s[n];

	

	for(int i=0 ; i<n ;i++){

		cin>>s[i];

	}

	sort(s, s+n);

	for(int i=0 ; i<n ;i++){

		cout<<s[i];

	}

	

	return 0;

	}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    string aarr[105];

    int n,l;

    cin>>n>>l;

    for(int i=0;i<n;i++)

    {

        cin>>aarr[i];

    }

    sort(aarr,aarr+n);

    for(int i=0;i<n;i++)

    {

        cout<<aarr[i];

    }

}










// Faster C++ solution for the same problem (measured speedup: 3.510806987225282x):
#include <iostream>

#include <algorithm>

#include <string>

#include <vector>

using namespace std;

int main()

{

	int N, L;

	cin >> N >> L;

	string x;

	vector<string> s;

	for (int i = 0; i < N; i++){

		cin >> x;

		s.push_back(x);

		}

	sort(s.begin(), s.end());

		for (int i = 0; i < N; i++)

			cout << s[i];

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    string aarr[105];

    int n,l;

    cin>>n>>l;

    for(int i=0;i<n;i++)

    {

        cin>>aarr[i];

    }

    sort(aarr,aarr+n);

    for(int i=0;i<n;i++)

    {

        cout<<aarr[i];

    }

}










// Faster C++ solution for the same problem (measured speedup: 3.4588988898399897x):
#include<bits/stdc++.h>

using namespace std;





#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define endl '\n'



int main()



{

    optimize();



    int n,l;

    vector<string> v;

    string s;

    cin>>n>>l;

    for(int i=0;i<n;i++)

    {

       cin>>s;

        v.push_back(s);

    }

    sort( v.begin(),v.end());

    for(string u:v )

        cout<<u;





















    return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    string aarr[105];

    int n,l;

    cin>>n>>l;

    for(int i=0;i<n;i++)

    {

        cin>>aarr[i];

    }

    sort(aarr,aarr+n);

    for(int i=0;i<n;i++)

    {

        cout<<aarr[i];

    }

}










// Faster C++ solution for the same problem (measured speedup: 3.5081366111999346x):
#include<bits/stdc++.h>

#define ll long long int

#define pb push_back

#define mp make_pair

using namespace std;

main()

{

    int n,l,i;

    string s,p;

    vector<string>v;

    cin>>n>>l;

    for(i=0;i<n;i++)

    {

        cin>>s;

        v.pb(s);

    }

    sort(v.begin(),v.end());

    for(i=0;i<v.size();i++)

        p+=v[i];

    cout<<p;

}
// Slower C++ solution:


#include<bits/stdc++.h>

#define lln long long int

#define llu unsigned lln

#define sc(n) scanf("%d",&n);

#define scl(n) scanf("%lld",&n);

#define scd(n) scanf("%lf",&n);

#define pf(res) printf("%d\n",res);

#define pfl(res) printf("%lld\n",res);

#define pfd(res) printf("%lf\n",res);

#define maxii 100005

using namespace std;

typedef pair<int,int> pii;

typedef pair<lln,lln> pll;

 vector<int> vi[maxii];

 vector<int>:: iterator child;

typedef vector<lln> vl;

typedef vector<pii> vii;

typedef vector<pll> vll;





int arr[maxii];

int arr2[maxii];

bool check[maxii];



bool dfs(int node,int c)

{

    check[node]=true;

    arr2[node]=c;

    for(int child=0;child<vi[node].size();child++)

    {

        if(check[vi[node][child]]==false)

        {

            if(dfs(vi[node][child],c^1)==false)

            {

                return false;

            }

        }

        else if(arr2[node]==arr2[vi[node][child]])

        {

            return false;

        }

        //else if()

    }

    return true;

}



int main()

{

    string aarr[105];

    int n,l;

    cin>>n>>l;

    for(int i=0;i<n;i++)

    {

        cin>>aarr[i];

    }

    sort(aarr,aarr+n);

    for(int i=0;i<n;i++)

    {

        cout<<aarr[i];

    }

}










// Faster C++ solution for the same problem (measured speedup: 3.5079286504289797x):
//JI SRI KRISHNA.//

#include<iostream>

#include<algorithm>

using namespace std;

int main()

{

    int n,m,i;

    cin>>n>>m;

    string s[n];

    for(i=0;i<n;i++)

        cin>>s[i];

    sort(s,s+n);

    for(i=0;i<n;i++)

        cout<<s[i];

    cout<<endl;

}