import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	}
	
	static void readArray(int[] arr,Scanner sc) { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	}
	
	
	

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	}
	
	static void readArray(int[] arr,Scanner sc) { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	}
	
	
	

} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	} main {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) PriorityQueue<String> t=new PriorityQueue<>(); t new PriorityQueue<>() int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int l=sc.nextInt(); l sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++) {
				t.add(sc.next());
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				t.add(sc.next());
			} {
				t.add(sc.next());
			} t.add(sc.next()) t.add t sc.next() sc.next sc while(!t.isEmpty()) {
			System.out.print(t.poll());
		} !t.isEmpty() t.isEmpty() t.isEmpty t {
			System.out.print(t.poll());
		} System.out.print(t.poll()) System.out.print System.out System System.out t.poll() t.poll t System.out.println() System.out.println System.out System System.out String[] args args static void readArray(int[] arr,Scanner sc) { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	} readArray { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	} for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
			arr[i]=sc.nextInt();
		} {
			arr[i]=sc.nextInt();
		} arr[i]=sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc int[] arr arr Scanner sc sc public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	}
	
	static void readArray(int[] arr,Scanner sc) { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	}
	
	
	

} public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	}
	
	static void readArray(int[] arr,Scanner sc) { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	}
	
	
	

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
			PriorityQueue<String> t=new PriorityQueue<>();
			int n=sc.nextInt();
			int l=sc.nextInt();
			for(int i=0;i<n;i++) {
				t.add(sc.next());
			}
		while(!t.isEmpty()) {
			System.out.print(t.poll());
		}
		System.out.println();

	}
	
	static void readArray(int[] arr,Scanner sc) { 
		for(int i=0;i<arr.length;i++) {
			arr[i]=sc.nextInt();
		}
	}
	
	
	

}