stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:


#include<bits/stdc++.h>

#define sz(x) ((int)(x).size())

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

#define per(i,a,b) for (int i=(b-1); i>=(a); i--)

#define debug(x) cout << #x << " => " << x << endl

using namespace std;



#define fi first

#define se second

#define mp make_pair

typedef pair<int,int> pii;



#define pb push_back

typedef vector<int> vi;



typedef long long ll;

typedef long double ld;



const int MAX_N = 7 + 100;

///----------------------------------------------

string str[MAX_N]; 

int main() {



	///read

	int n,l; cin>>n>>l;

	rep(i,0,n) cin>>str[i];



	///prework

	sort(str, str+n);



	///print

	rep(i,0,n) cout << str[i];



}


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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

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

#include<algorithm>

#include <stdio.h>

#include <string.h>

#include <map>

using namespace std;

int N,L;

int main()

{

    cin>>N>>L;

    string a[N];

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

    {

        cin>>a[i];

    }

    sort(a,a+N);

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

    {

        cout<<a[i];

    }

return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

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

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<algorithm>

using namespace std;

string str[110];

int main()

{

    int N,L,i,flag=0;

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

    getchar();

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

        cin >> str[i];

   sort(str,str+N);

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

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

    cout << str[i];

    return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

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

#include <cstdlib>

#include <cstring>

#include <stdio.h>

using namespace std;



struct Str {

	char s[105];

}str[100];



int cmp(const void *a, const void *b) {

	const struct Str *p1 = (const struct Str*)a;

	const struct Str *p2 = (const struct Str*)b;

	return strcmp(p1->s, p2->s);



}



int main() {

	int n, l;

	cin >> n >> l;

	getchar();

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

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

        getchar();

	}

	qsort(str, n, sizeof(Str), cmp);

	for (int i = 0; i < n; i++) printf("%s",str[i].s);

	return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

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

#include<cstdio>

#include<cstring>

#include<string>

#include<algorithm>

using namespace std;



char str[1005];  

int n,hsh[30],cnt,len; 



bool cmp(string a,string b){

	return a < b;

}



int main()  

{  

    string str[100];

    int N,M;

    cin >> N >> M;

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

    	cin >> str[i];

	}

	sort(str,str+N,cmp);

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

		cout << str[i];

	}

	cout << endl;

    return 0;  

}  

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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

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

    #include<cstdio>

    #include<cstring>

    #include<algorithm>

    using namespace std;



    struct node

    {

        char st[101];

    }a[100];

    bool cmp(node s1,node s2)

    {

        return strcmp(s1.st,s2.st)<0;

    }



    int main()

    {

        int n,l;

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

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

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

        }

        sort(a,a+n,cmp);

        for(int i=0;i<n;i++) printf("%s",a[i].st);

        return 0;

    }


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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

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

#include<algorithm>

#include<string.h>

#include<stdio.h>

using namespace std;

struct node

{

    char a[104];

}st[200];

bool cmp(node s1,node s2)

{

    return strcmp(s1.a,s2.a)<0;

}

int main()

{

    int n,l;

    while(cin>>n>>l)

    {

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

        {

                cin>>st[i].a;

        }

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

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

         {

                cout<<st[i].a;

        }

        cout<<endl;

    }

}


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

#include<cstring>

#include<algorithm>

using namespace std;

struct edge

{

	char a[120];

	int x;

};

int main(void)

{

	int n, l, i, j;

	edge s[300];

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

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

	{

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

	}

	edge r;

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

	{

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

		{

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

			{

				r = s[i];

				s[i] = s[j];

				s[j] = r;

			}

		}

	}

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

	{

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

	}

	return 0;

}
// Slower C++ solution:


#include <bits/stdc++.h> 

using namespace std; 



string s[10000];



bool compare( string a, string b)

{

	return a+b < b+a ;

}





int main()

{

	int n,l; cin>>n>>l;



	

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

	cin>>s[i];

	

	sort( s, s+n ,compare);

//	sort(s, s+n) ;

	

	string ans="";

	

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

	ans= ans + s[i];

	

	cout<<ans<<endl;

	

}

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

#include<vector>

#include<algorithm>

using namespace std;

int main()

{

    int n,l,i;



    cin >> n >> l;



    vector<string>s(n);



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

        cin >> s[i];



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



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

        cout << s[i];



    cout << endl;

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

using namespace std;

int  main (){

  string a[105][105];

  int n,l;

  cin>>n>>l;

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

    cin>>a[0][i];

  }

  sort(a[0],a[0]+n);

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

    cout<<a[0][i];

  }

  cout<<"\n";

  return(0);

}



  


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

using namespace std;

int  main (){

  string a[105];

  int n,l;

  cin>>n>>l;

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

    cin>>a[i];

  }

  sort(a,a+n);

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

    cout<<a[i];

  }

  cout<<"\n";

  return(0);

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

#include<cstdio>

#include<string>

#include<algorithm>

using namespace std;

int read(){

    int f=1,x=0;

    char ch;

    do{ch=getchar();if(ch=='0')f=-1;}while(ch<'0'||ch>'9');

    do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');

    return f*x;

}



string s[10001];

int n,l;

int main(){

    n=read();

    l=read();

    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: 1.323514544685568x):
#include "bits/stdc++.h"

using namespace std;

typedef string djrjfrogj;

bool cmp(djrjfrogj a,djrjfrogj b){

    return a<b;

}

int main(){

    int n,grmgktr;

    cin>>n>>grmgktr;

    djrjfrogj s[n];

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

        cin>>s[i];

    sort(s,s+n,cmp);

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

        cout<<s[i];

    return 0;

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

#include<cstdio>

#include<string>

#include<algorithm>

using namespace std;

int read(){

    int f=1,x=0;

    char ch;

    do{ch=getchar();if(ch=='0')f=-1;}while(ch<'0'||ch>'9');

    do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');

    return f*x;

}



string s[10001];

int n,l;

int main(){

    n=read();

    l=read();

    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: 1.3243662166508152x):
#include <bits/stdc++.h>

#define ll long long

using namespace std;

void put(int x){

	if(x<0) {

		putchar('-');

		x*=-1;

	}

	if(x==0) {

		putchar('0');

	}

	int num=0;

	char c[15];

	while(x) {

		c[++num]=(x%10)+48;

		x/=10;

	}

	while(num) {

		putchar(c[num--]);

	}

	putchar('\n');

}

inline void in(int &x){

	char ch=getchar();

	int flag=1;

	while(!(ch>='0'&&ch<='9')) {

		if(ch=='-')

			flag*=-1;

		ch=getchar();

	}

	x=ch-'0';

	ch=getchar();

	while(ch>='0'&&ch<='9') {

		x=((x<<3)+(x<<1))+ch-'0';

		ch=getchar();

	}

	x*=flag;

}

int n,l;string a[105];

bool cmp(string a,string b){

	return a<b;

}

int main(){

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

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

	in(n);in(l);

	for(int i=1;i<=n;i++)cin>>a[i];

	sort(a+1,a+n+1,cmp);

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

	return 0;

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

#include<iomanip>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

using namespace std;

int main()

{  int n,l;

   string a[10005];

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

   for(int i=1;i<=n;i++)cin>>a[i];

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

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

   return 0;

}

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

#define ll long long

using namespace std;

void put(int x){

	if(x<0) {

		putchar('-');

		x*=-1;

	}

	if(x==0) {

		putchar('0');

	}

	int num=0;

	char c[15];

	while(x) {

		c[++num]=(x%10)+48;

		x/=10;

	}

	while(num) {

		putchar(c[num--]);

	}

	putchar('\n');

}

inline void in(int &x){

	char ch=getchar();

	int flag=1;

	while(!(ch>='0'&&ch<='9')) {

		if(ch=='-')

			flag*=-1;

		ch=getchar();

	}

	x=ch-'0';

	ch=getchar();

	while(ch>='0'&&ch<='9') {

		x=((x<<3)+(x<<1))+ch-'0';

		ch=getchar();

	}

	x*=flag;

}

int n,l;string a[105];

bool cmp(string a,string b){

	return a<b;

}

int main(){

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

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

	in(n);in(l);

	for(int i=1;i<=n;i++)cin>>a[i];

	sort(a+1,a+n+1,cmp);

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

	return 0;

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

#include<cstdio>

#include<string>

#include<algorithm>

using namespace std;

int read(){

    int f=1,x=0;

    char ch;

    do{ch=getchar();if(ch=='0')f=-1;}while(ch<'0'||ch>'9');

    do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');

    return f*x;

}



string s[10001];

int n,l;

int main(){

    n=read();

    l=read();

    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: 1.3246730452097213x):
#include<bits/stdc++.h>

using namespace std;

template<typename T>inline void read(T &x){

	short f=1;x=0;char c=getchar();

	while(!isdigit(c)){ if(c=='-')f=-1;c=getchar(); }

	while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();

	x*=f;

}

template<typename T>inline void write(T x){

	if(x<0)putchar('-'),x=-x;

	if(x>9)write(x/10);

	putchar(x%10+'0');

}

template<typename T>inline void writeln(T x){

	write(x);putchar('\n');

}

int main(){

	int n,l;

	string s[110];

	read(n),read(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];

	putchar('\n');

	return 0;

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

#include<iomanip>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

using namespace std;

int main()

{  int n,l;

   string a[10005];

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

   for(int i=1;i<=n;i++)cin>>a[i];

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

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

   return 0;

}

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

using namespace std;

template<typename T>inline void read(T &x){

	short f=1;x=0;char c=getchar();

	while(!isdigit(c)){ if(c=='-')f=-1;c=getchar(); }

	while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();

	x*=f;

}

template<typename T>inline void write(T x){

	if(x<0)putchar('-'),x=-x;

	if(x>9)write(x/10);

	putchar(x%10+'0');

}

template<typename T>inline void writeln(T x){

	write(x);putchar('\n');

}

int main(){

	int n,l;

	string s[110];

	read(n),read(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];

	putchar('\n');

	return 0;

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

#include<algorithm>

#include<cstring>

#include<cmath>

#include<queue>

using namespace std;

int main()

{    

	int n,m;

	cin>>n>>m;

	string a[10001];

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

		cin>>a[i];

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

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

	{

		cout<<a[i];

	}

    cout<<endl;

	return 0;

}




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

#include<string>

#include<algorithm>

using namespace std;

int main()

{

	string s[109];

	int n,l;

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

	return 0;

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



using namespace std;



int main()

{

    int n, l;

    vector<string> string_vector;

    string s;

    cin >> n >> l;

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

       cin >> s;

       string_vector.push_back(s);



    }

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

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

        cout << string_vector[i];

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.257793296533387x):
#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;

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

using namespace std;



#define getn int n; cin >> n

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

#define forj(n) for (int j = 0; j < (n); j++)

#define forifill(n,x) for (int i = 0; i < (n); i++) cin >> x[i]

#define foriprint(n,x,sep) for (int i = 0; i < (n); i++) cout << x[i] << sep;

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

#define allr(x) (x).rbegin(), (x).rend()

#define unsync cin.sync_with_stdio(false), cin.tie(0)

#define inoutfile freopen("d:\\testcase.txt", "r", stdin);freopen("d:\\output.txt", "w", stdout)



typedef unsigned long long lng;





int main()

{

	unsync;



	int n, l;

	cin >> n >> l;

	string x[105];

	forifill(n, x);

	sort(x, x + n);

	foriprint(n, x, "");

	cout << "\n";

}


// Faster C++ solution for the same problem (measured speedup: 5.329534696153433x):
#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;

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

#include <string.h>

#include <iostream>

using namespace std;

int main()

{

	char st[1001][101],te[101];

	int n,l,i,ii;

	cin>>n>>l;

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

	cin>>st[i];

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

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

		if(strcmp(st[ii],st[ii+1])>0)

		{

			strcpy(te,st[ii]);

			strcpy(st[ii],st[ii+1]);

			strcpy(st[ii+1],te);

		}

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

		cout<<st[i];

		return 0;

}

		

// Faster C++ solution for the same problem (measured speedup: 5.197243243067076x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.291812801816493x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.295214124826082x):
#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;

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

	}

// Faster C++ solution for the same problem (measured speedup: 5.288427359747708x):
#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;

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

}  

// Faster C++ solution for the same problem (measured speedup: 5.441618531168212x):
#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;

}