stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<cstdio>

#include<algorithm>

#include<iostream>

#include<vector>

using namespace std;

int main(void)

{

    int n,l;

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

    {

    	vector<string>words;

    	string s;

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

       {

       	cin>>s;

       	words.push_back(s);

	   }

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

	   for(int i=0;i<words.size();i++)

	    cout<<words[i];

	    cout<<endl;

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char str[101][101];

char k[101];

int main()

{

	int i,j,m,n;

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

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

	{

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

	}

	for(j=0 ; j<m ; j++)

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

		{

			if (strcmp(str[i],str[i+1])>0)

			{

				strcpy(k,str[i]);

				strcpy(str[i],str[i+1]);

				strcpy(str[i+1],k);

			}

		}

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

		{

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

		}

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main() {

	int n, l;

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

	vector <string> a(n);

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

		string str;

		cin >> str;

		a[i] = str;

	}

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

	string ans = "";

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

		ans += a[i];

	}

	cout << ans << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char str[101][101];

char k[101];

int main()

{

	int i,j,m,n;

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

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

	{

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

	}

	for(j=0 ; j<m ; j++)

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

		{

			if (strcmp(str[i],str[i+1])>0)

			{

				strcpy(k,str[i]);

				strcpy(str[i],str[i+1]);

				strcpy(str[i+1],k);

			}

		}

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

		{

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

		}

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstring>

#include <cmath>

#include <algorithm>

#include <iostream>

#include <sstream>

#include <queue>

#include <map>

#include <vector>

#include <set>

#include <cstdlib>

#include <stack>



using namespace std;



typedef long long LL;

#define FAST ios::sync_with_stdio(false);

const int MaxN = 105;

priority_queue <string,vector<string>,greater<string> > que;

int main()

{

	int n , l;

	cin >> n >> l;

	while(n--){

		string a;

		cin >> a;

		que.push(a);

		}

	while(!que.empty())

	{

		string s;

		s = que.top();

		cout << s;

		que.pop();

		}

	cout << endl;

	return 0;

	}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char str[101][101];

char k[101];

int main()

{

	int i,j,m,n;

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

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

	{

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

	}

	for(j=0 ; j<m ; j++)

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

		{

			if (strcmp(str[i],str[i+1])>0)

			{

				strcpy(k,str[i]);

				strcpy(str[i],str[i+1]);

				strcpy(str[i+1],k);

			}

		}

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

		{

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

		}

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

#include<algorithm>

using namespace std;

string s[1001];

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;

	

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

		cin>>s[i];

		count++;

	}

	sort(s,s+n,cmp);

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

		cout<<s[i];

	}

	cout<<endl; 

	return 0;

}  

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char str[101][101];

char k[101];

int main()

{

	int i,j,m,n;

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

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

	{

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

	}

	for(j=0 ; j<m ; j++)

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

		{

			if (strcmp(str[i],str[i+1])>0)

			{

				strcpy(k,str[i]);

				strcpy(str[i],str[i+1]);

				strcpy(str[i+1],k);

			}

		}

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

		{

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

		}

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;

inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }

template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }

template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }

template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }

template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }



/*

 <url:>

 問題文============================================================

 =================================================================

 解説=============================================================

 ================================================================

 */

int main(void) {

    cin.tie(0); ios_base::sync_with_stdio(false);

    int N,L; cin >> N >> L;

    vector<string> S(N); for(auto& in:S) cin >> in;

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

    for(auto s:S) cout << s; cout << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char str[101][101];

char k[101];

int main()

{

	int i,j,m,n;

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

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

	{

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

	}

	for(j=0 ; j<m ; j++)

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

		{

			if (strcmp(str[i],str[i+1])>0)

			{

				strcpy(k,str[i]);

				strcpy(str[i],str[i+1]);

				strcpy(str[i+1],k);

			}

		}

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

		{

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

		}

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<iostream>

#include<algorithm>

#define ll long long

#define Di 3.1415926

#include<math.h>

#include<string>

#include<stack>

#define INF 0x3f3f3f3f

using namespace std;

ll  gcd(ll a,ll b)

{

    return a%b? gcd(b,a%b):b;

}

struct Node

{

    int t;

    char a[102];

}s[102];

bool cmp(Node a,Node b)

{

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

}

int main()

{    int m,n,i,j;

     cin>>m>>n;

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

     {

         cin>>s[i].a;

         s[i].t=i+1;

     }

     sort(s,s+m,cmp);

   /*  for(i=0;i<m-1;i++)

     {

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

         {

             if(strcmp(s[i].a,s[j].a))

             {

                 int t=s[i].t;

                 s[i].t=s[j].t;

                 s[j].t=t;

             }

         }

     }*/

    // sort(s,s+m,cmp);

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

     {

         cout<<s[i].a;

     }

     cout<<endl;



 return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

char str[101][101];

char k[101];

int main()

{

	int i,j,m,n;

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

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

	{

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

	}

	for(j=0 ; j<m ; j++)

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

		{

			if (strcmp(str[i],str[i+1])>0)

			{

				strcpy(k,str[i]);

				strcpy(str[i],str[i+1]);

				strcpy(str[i+1],k);

			}

		}

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

		{

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

		}

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//#include<bits/stdc++.h>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<cmath>

#include<iostream>

#include<algorithm>

#include<queue>

#include<vector>

#include<stdio.h>

#include<stack>

using namespace std;

string q[100001];

bool qaq(string x,string y)

{

	return x<y;

}

int main()

{

	int a,b;

	cin>>a>>b;

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

		cin>>q[i];

	sort(q+1,q+a+1,qaq);

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

		cout<<q[i];

	return 0;

}


// Optimized solution to the same problem (faster):
#include<iostream>

#include<fstream>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<string>

#include<cstring>

using namespace std;

int n,m;

string st[110];

int main()

{

	cin>>n>>m;

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

		cin>>st[i];

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

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

		cout<<st[i];

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define INF 100001

using namespace std;

inline int read()

{

	register int number_read=0,if_ok_read=1;

	char ch_read=getchar();

	while(ch_read<'0'||ch_read>'9')

	{

		if(ch_read=='-')

			if_ok_read=-1;

		ch_read=getchar();

	}

	while(ch_read>='0'&&ch_read<='9')

	{

		number_read=number_read*10+ch_read-'0';

		ch_read=getchar();

	}

	return number_read*if_ok_read;

}

inline void write(register int x_write)

{

    if(x_write<0)

	{

    	putchar('-');

		x_write=-x_write;

	}

    if(x_write>9)

		write(x_write/10);

    putchar(x_write%10+'0');

    return ;

}

int main()

{

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	int n=read(),l=read() ;

	string s[INF];

	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;

}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

string s[101];

int main()

{

    int n,l;

    cin>>n>>l;

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

        cin>>s[i];

    sort(s,s+n+1);

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

    	cout<<s[i];

    cout<<endl;

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstring>

using namespace std;

string st[10000];

int n,m;

int main()

{

	cin>>n>>m;

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

		cin>>st[i];

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

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

    	if (st[i]>st[j]) swap(st[i],st[j]);

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

    {

    	cout<<st[i];

    }

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

string a[101];

int n,l;

int main(){

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

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

        cin>>a[i];

    sort(a,a+n);

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

        cout<<a[i];

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;



int main() {

	int n,l;

	string s[100000];

	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;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <algorithm>

#include <string>

#include <vector>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cstring>

#include <stack>

#include <queue>

#include <set>

#include <map>

#include <utility>

#include <ctime>

#define INF 1000000000

#define LINF 9000000000000000000

#define mod 1000000007

 

#define rep(i,n) for(int i=0;i<int(n);i++)

#define rrep(i,n) for(int i=(n);i>=0;i--)

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

#define all(x) (x).begin(),x.end()

#define rsort(x) sort(all(x));reverse(all(x))

#define pb push_back

#define mp make_pair

#define MOD(x) (x%(mod))

using namespace std;

 

typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef pair<int,int> pi;

 

int dx[4]={1,0,-1,0};

int dy[4]={0,1,0,-1};



bool debug=false;

/*---------------------------------------------------*/



int main(){

  int n,l;

  string s[105];

  cin>>n>>l;

  rep(i,n)cin>>s[i];

  sort(s,s+n);

  rep(i,n)cout<<s[i];

  cout<<endl;

  return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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];

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;	  

		  

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;	  

		  

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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("");

}


// Optimized solution to the same problem (faster):
#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;	  

		  

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;	  

		  

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}




// Optimized solution to the same problem (faster):
#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;	  

		  

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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];

}

// Optimized solution to the same problem (faster):
#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;	  

		  

}




// Fastest known solution for this problem:
// Original C++ solution (slower):


#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];

    }

}










// Optimized solution to the same problem (faster):
#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;

	}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem: