import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
	public static void main(String[] args){
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main {
	public static void main(String[] args){
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 }
} Main public static void main(String[] args){
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 } main {
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int L=sc.nextInt(); L sc.nextInt() sc.nextInt sc ArrayList<String> S=new ArrayList<>(); S new ArrayList<>() for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 } int i=0; int i=0; i 0 i<N i N i++ i++ i {
			 S.add(sc.next());
		 } {
			 S.add(sc.next());
		 } S.add(sc.next()) S.add S sc.next() sc.next sc Collections.sort(S) Collections.sort Collections S for(int i=0;i<N;i++)
			 System.out.print(S.get(i)); int i=0; int i=0; i 0 i<N i N i++ i++ i System.out.print(S.get(i)); System.out.print(S.get(i)) System.out.print System.out System System.out S.get(i) S.get S i sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args){
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 }
} public class Main {
	public static void main(String[] args){
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 }
} Main
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
	public static void main(String[] args){
		 Scanner sc = new Scanner(System.in);
		 int N=sc.nextInt();
		 int L=sc.nextInt();
		 ArrayList<String> S=new ArrayList<>();
		 for(int i=0;i<N;i++) {
			 S.add(sc.next());
		 }
		 Collections.sort(S);
		 
		 for(int i=0;i<N;i++)
			 System.out.print(S.get(i));
	     sc.close();
	 }
}
