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