import java.util.*;
import java.io.*;
class Main{
	public static void main(String args[]){
    	Scanner in = new Scanner(System.in);
      	OutputStream outputstream = System.out;
      	//PrintWriter out = new PrintWriter(outputstream);
      	int N = in.nextInt();
      	int L = in.nextInt();
      	String[] s = new String[N];	
      	for(int i =0;i<N;i++){
          	s[i] = in.next();
        }
      	Arrays.sort(s);
      	String ans = "";
      	for(int i =0;i<N;i++){
        	ans+=s[i];
        }
      	System.out.println(ans);
    }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
	public static void main(String args[]){
    	Scanner in = new Scanner(System.in);
      	OutputStream outputstream = System.out;
      	//PrintWriter out = new PrintWriter(outputstream);
      	int N = in.nextInt();
      	int L = in.nextInt();
      	String[] s = new String[N];	
      	for(int i =0;i<N;i++){
          	s[i] = in.next();
        }
      	Arrays.sort(s);
      	String ans = "";
      	for(int i =0;i<N;i++){
        	ans+=s[i];
        }
      	System.out.println(ans);
    }
} Main public static void main(String args[]){
    	Scanner in = new Scanner(System.in);
      	OutputStream outputstream = System.out;
      	//PrintWriter out = new PrintWriter(outputstream);
      	int N = in.nextInt();
      	int L = in.nextInt();
      	String[] s = new String[N];	
      	for(int i =0;i<N;i++){
          	s[i] = in.next();
        }
      	Arrays.sort(s);
      	String ans = "";
      	for(int i =0;i<N;i++){
        	ans+=s[i];
        }
      	System.out.println(ans);
    } main {
    	Scanner in = new Scanner(System.in);
      	OutputStream outputstream = System.out;
      	//PrintWriter out = new PrintWriter(outputstream);
      	int N = in.nextInt();
      	int L = in.nextInt();
      	String[] s = new String[N];	
      	for(int i =0;i<N;i++){
          	s[i] = in.next();
        }
      	Arrays.sort(s);
      	String ans = "";
      	for(int i =0;i<N;i++){
        	ans+=s[i];
        }
      	System.out.println(ans);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) OutputStream outputstream = System.out; outputstream System.out System System.out int N = in.nextInt(); N in.nextInt() in.nextInt in int L = in.nextInt(); L in.nextInt() in.nextInt in String[] s = new String[N]; s new String[N] N for(int i =0;i<N;i++){
          	s[i] = in.next();
        } int i =0; int i =0; i 0 i<N i N i++ i++ i {
          	s[i] = in.next();
        } {
          	s[i] = in.next();
        } s[i] = in.next() s[i] s i in.next() in.next in Arrays.sort(s) Arrays.sort Arrays s String ans = ""; ans "" for(int i =0;i<N;i++){
        	ans+=s[i];
        } int i =0; int i =0; i 0 i<N i N i++ i++ i {
        	ans+=s[i];
        } {
        	ans+=s[i];
        } ans+=s[i] ans s[i] s i System.out.println(ans) System.out.println System.out System System.out ans String args[] args
import java.util.*;
import java.io.*;
class Main{
	public static void main(String args[]){
    	Scanner in = new Scanner(System.in);
      	OutputStream outputstream = System.out;
      	//PrintWriter out = new PrintWriter(outputstream);
      	int N = in.nextInt();
      	int L = in.nextInt();
      	String[] s = new String[N];	
      	for(int i =0;i<N;i++){
          	s[i] = in.next();
        }
      	Arrays.sort(s);
      	String ans = "";
      	for(int i =0;i<N;i++){
        	ans+=s[i];
        }
      	System.out.println(ans);
    }
}