stablegradients/pie-gem5-pairs huggingface dataset:
// 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.457698023976417x):
#include<bits/stdc++.h>

using namespace std;





//defines...

#define ll long long

#define tata return;

#define pb push_back

#define mp make_pair

#define in insert

#define run ios_base::sync_with_stdio(false);cin.tie(NULL);

#define yes cout<<"YES"<<endl;

#define no cout<<"NO"<<endl;

#define vec vector<ll>

#define setl set<ll>

#define mapl map<ll,ll>

#define shunno cout<<0<<endl;

#define pi 2*acos(0.0)1

#define hobena cout<<-1<<endl;















void oka()

{

    ll a,b;

    cin>>a>>b;

    multimap<string,string>m;

    while(a--)

    {

        string s;

        cin>>s;

        m.insert(pair<string,string>(s,s));

    }

    multimap<string,string>::iterator it;

    for(it=m.begin();it!=m.end();it++)

        cout<<it->second;

    cout<<endl;









}













int main()

{



   //string g="abcd";

    //g.erase(g.begin()+3);

    //cout<<g<<endl;

    //freopen("input.txt", "r", stdin);

    //freopen("output.txt", "w", stdout);



    run

    ll i,t;

    t=1;

  // cin>>t;





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

    {





    oka();

    }













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



using namespace std;

string s[101];

int n, l;

int main()

{

    cin >> n >> l;

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

        cin >> s[i];

    sort(s, s+n);

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

    cout << endl;

    return 0;

}


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

#include<stdio.h>

#include<string.h>

#include<queue>

using namespace std;



/*int pre[200006];



int fin(int x)

{

    int r=x;

    while(pre[r]!=r)

        r=pre[r];

    int i=x,j;

    while(i!=r)

    {

        j=pre[i];

        pre[i]=r;

        i=j;

    }

    return r;

}



void unite(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        pre[fx]=fy;

}



bool same(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        return false;

    return true;

}*/



struct S

{

    char a[105];

};



bool cmp(S a,S b)

{

    return strcmp(a.a,b.a)<0;

}



int main()

{

    int i,k,x,y,j,n,m;

    S p[105];

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

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

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

    sort(p,p+n,cmp);

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

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

    printf("\n");

    return 0;

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

#include<cstdio>

#include<cstring>

#include<string>

#include<map>

#include<algorithm>

using namespace std;

string str[110];

int main()

{

    int n,l;

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

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

            cin>>str[i];

        }

        sort(str,str+n);

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

        printf("\n");

    }

    return 0;

}


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

#include<stdio.h>

#include<string.h>

#include<queue>

using namespace std;



/*int pre[200006];



int fin(int x)

{

    int r=x;

    while(pre[r]!=r)

        r=pre[r];

    int i=x,j;

    while(i!=r)

    {

        j=pre[i];

        pre[i]=r;

        i=j;

    }

    return r;

}



void unite(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        pre[fx]=fy;

}



bool same(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        return false;

    return true;

}*/



struct S

{

    char a[105];

};



bool cmp(S a,S b)

{

    return strcmp(a.a,b.a)<0;

}



int main()

{

    int i,k,x,y,j,n,m;

    S p[105];

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

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

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

    sort(p,p+n,cmp);

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

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

    printf("\n");

    return 0;

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

#include<stdio.h>

#include<algorithm>

#include<math.h>

#include<stack>

#include<string.h>

#include<queue>

#include<ctype.h>

#include<map>

#include<string>

using namespace std;

int main(){

    int a,b;

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

    char ch[102][102];

    string str[102];

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

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

        str[i]=ch[i];

    }

    sort(str,str+a);

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

        cout<<str[i];

    }

    cout<<endl;

}


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

#include<stdio.h>

#include<string.h>

#include<queue>

using namespace std;



/*int pre[200006];



int fin(int x)

{

    int r=x;

    while(pre[r]!=r)

        r=pre[r];

    int i=x,j;

    while(i!=r)

    {

        j=pre[i];

        pre[i]=r;

        i=j;

    }

    return r;

}



void unite(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        pre[fx]=fy;

}



bool same(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        return false;

    return true;

}*/



struct S

{

    char a[105];

};



bool cmp(S a,S b)

{

    return strcmp(a.a,b.a)<0;

}



int main()

{

    int i,k,x,y,j,n,m;

    S p[105];

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

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

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

    sort(p,p+n,cmp);

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

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

    printf("\n");

    return 0;

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

#include <cstdio>

#include <set>

#include <map>

#include <stack>

#include <vector>

#include <queue>

#include <string>

#include <cstring>

#include <cmath>

#include <algorithm>

#define esp 1e-9

#define INF 0x3f3f3f3f

#define Pi acos(-1.0)

const int maxn = 1e3;

typedef long long ll;

using namespace std;

struct strstrstr

{

    string s;

};

strstrstr t[maxn];

bool cmp(struct strstrstr &a, struct strstrstr &b)

{

    return a.s < b.s;

}

int main()

{

    int n, l;

    cin>>n>>l;

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

    {

        string str;

        cin>>str;

        t[i].s = str;

    }

    sort(t, t+n, cmp);

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

        cout<<t[i].s;

    cout<<endl;

    return 0;

}


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

#include<stdio.h>

#include<string.h>

#include<queue>

using namespace std;



/*int pre[200006];



int fin(int x)

{

    int r=x;

    while(pre[r]!=r)

        r=pre[r];

    int i=x,j;

    while(i!=r)

    {

        j=pre[i];

        pre[i]=r;

        i=j;

    }

    return r;

}



void unite(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        pre[fx]=fy;

}



bool same(int x,int y)

{

    int fx=fin(x);

    int fy=fin(y);

    if(fx!=fy)

        return false;

    return true;

}*/



struct S

{

    char a[105];

};



bool cmp(S a,S b)

{

    return strcmp(a.a,b.a)<0;

}



int main()

{

    int i,k,x,y,j,n,m;

    S p[105];

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

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

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

    sort(p,p+n,cmp);

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

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

    printf("\n");

    return 0;

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



using namespace std;

string s[101];

int n, l;

int main()

{

    cin >> n >> l;

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

        cin >> s[i];

    sort(s, s+n);

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

    cout << endl;

    return 0;

}


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

#include<cstdio>

#include<cstring>

#include<string>

#include<map>

#include<algorithm>

using namespace std;

string str[110];

int main()

{

    int n,l;

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

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

            cin>>str[i];

        }

        sort(str,str+n);

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

        printf("\n");

    }

    return 0;

}


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

#include<stdio.h>

#include<algorithm>

#include<math.h>

#include<stack>

#include<string.h>

#include<queue>

#include<ctype.h>

#include<map>

#include<string>

using namespace std;

int main(){

    int a,b;

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

    char ch[102][102];

    string str[102];

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

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

        str[i]=ch[i];

    }

    sort(str,str+a);

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

        cout<<str[i];

    }

    cout<<endl;

}


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

#include <cstdio>

#include <set>

#include <map>

#include <stack>

#include <vector>

#include <queue>

#include <string>

#include <cstring>

#include <cmath>

#include <algorithm>

#define esp 1e-9

#define INF 0x3f3f3f3f

#define Pi acos(-1.0)

const int maxn = 1e3;

typedef long long ll;

using namespace std;

struct strstrstr

{

    string s;

};

strstrstr t[maxn];

bool cmp(struct strstrstr &a, struct strstrstr &b)

{

    return a.s < b.s;

}

int main()

{

    int n, l;

    cin>>n>>l;

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

    {

        string str;

        cin>>str;

        t[i].s = str;

    }

    sort(t, t+n, cmp);

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

        cout<<t[i].s;

    cout<<endl;

    return 0;

}


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

}
// Slower C++ solution:
#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]]++;

     map<string, int> ::iterator it;

     for (it =str.begin();it!=str.end();it++)

     	for (int i=0;i<it->second;i++)

     		cout<<it->first;

    cout<<endl;

    cout<<endl;

    return 0;

}

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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

#include <string.h>

#include <iostream>

#include <algorithm>

#include <math.h>

#include <limits.h>

#include <map>

#include <stack>

#include <queue>

#include <vector>

#include <set>

#include <string>

#define ll long long

#define ull unsigned long long

#define ms(a) memset(a,0,sizeof(a))

#define pi acos(-1.0)

#define INF 0x7f7f7f7f

#define lson o<<1

#define rson o<<1|1

const double E=exp(1);

const int maxn=1e3+10;

const int mod=1e9+7;

using namespace std;

int main(int argc, char const *argv[])

{

	int n,m;

	cin>>n>>m;

	string ch[maxn];

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

	{

		cin>>ch[i];

		// a[i]=ch[i][0];

	}

	sort(ch+0,ch+n);

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

		cout<<ch[i];

	cout<<endl;

	// n=unique(a,a+n)-a;

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

	// {

	// 	cout<<a[i];

	// 	for(int j=1;j<m;j++)

	// 		cout<<"x";

	// }

	// cout<<endl;

	return 0;

}

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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

using namespace std;



string Array[105];



int main(){

	int N,L;

	scanf("%d %d",&N,&L);

	string s;

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

	{

		cin >> s;

		Array[i]=s;

	}

	sort(Array,Array+N);

	string Con="";

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

	{

		Con+=Array[i];

	}

	cout << Con;

	return 0;

}

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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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



using namespace std;



int main(){

	int n;

	cin>>n;

	int l;

	cin>>l;

	string x;

	vector <string> V(n);

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

		cin>>V.at(i);

	}

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

	int mal=V.size();

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

		cout<<V.at(i);

	}

	cout<<endl;

	return 0;

}


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

#include<string>

#include<algorithm>

using namespace std;

static bool  cmp(string s1, string s2){

     return (s1 + s2) < (s2 + s1)? true : false;

}

int main(){

	int n,m,count=0,i,j;

	cin>>n>>m;

	string s[101];



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

		cin>>s[i];

		count++;

	}

	sort(s,s+count,cmp);

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

		cout<<s[i];

	}

	cout<<endl; 

	return 0;

}  

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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <cstdlib>

#include <algorithm>

#include <iomanip>

#include <climits>

#include <map>

using namespace std;

string s[105];

int main()

{

	int L,N;

	cin >> N >> L;

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

		cin >> s[i];

	}

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

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

		cout << s[i];

	}

	return 0;

}

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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

                using namespace std;

                typedef long long ll;

                #define MAX 200005

                int main()

                {

                   vector<string> s;

                   int n , l;

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

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

                   {

                       string a;

                       cin>>a;

                       s.push_back(a);

                   }

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

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

                   {

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

                   }

                }


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

}
// Slower C++ solution:
/*

           Nothing is absolute.

     This is the only absolute truth.

*/



#include<bits/stdc++.h>



using namespace std;



using ull = unsigned long long;

using ll = long long;



#define READ freopen("in.txt", "r", stdin)

#define ROUT freopen("out.txt", "w", stdout)

#define pb push_back

#define endl '\n'



#define REP(i,a,b) for(int i=a; i<=b; i++)

#define arrL(i,a,b) for(int i=a; i<b; i++)



void fasterIO()

{

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

}



void fileIO()

{

    READ;

    ROUT;

}



void solve()

{

    int n, l;



    string s, ans;



    vector<string>v;



    cin>>n>>l;



    while(n--){

        cin>>s;



        v.pb(s);

    }



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



    ans=v[0];



    if(v.size()>1){

        arrL(i, 1, v.size()){

            ans+=v[i];

        }

    }



    cout<<ans<<endl;

}



int main()



{

    ///fileIO();

    fasterIO();



    solve();



    return 0;

}


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

#include<string.h>

    char s[105][105];

    int n,l,i,j;

    char a[105];

    int main()

    {

    while(~scanf("%d%d",&n,&l))

       {

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

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

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

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

             if(strcmp(s[j],s[j+1])>0)

                {

                strcpy(a,s[j]);

                strcpy(s[j],s[j+1]);

                strcpy(s[j+1],a);

                }

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

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

       printf("\n");

    }

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

 #include<string>

 using namespace std;



 int main()

 {

     int N,L,i,j;

     string s[101];

     string a[10001];

     string temp;



     cin>>N>>L;

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

        cin>>s[i];

     }



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

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

            if(s[j]>s[j+1]){

                temp = s[j];

                s[j] = s[j+1];

                s[j+1] = temp;

            }

        }

     }

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

        cout<<s[i];

     }

     cout<<endl;



     return 0;

 }


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

 

using namespace std;

 

typedef long long ll;

 

int main() {

#ifndef ONLINE_JUDGE

    //freopen("input.txt", "r", stdin);

    //freopen("output.txt", "w", stdout);

#endif

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    int n, l;

    cin >> n >> l;

    vector <string> s(n);

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

        cin >> s[i];

    }

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

    string ans = "";

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

        ans += s[i];

    }

    cout << ans << "\n";

    return 0;

}