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



public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner 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();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	} 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 List<String> strlist = new ArrayList<String>(); strlist new ArrayList<String>() for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			strlist.add(sc.next());
		} {
			strlist.add(sc.next());
		} strlist.add(sc.next()) strlist.add strlist sc.next() sc.next sc Collections.sort(strlist) Collections.sort Collections strlist StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String string : strlist) {
 			sb.append(string);
		} String string strlist {
 			sb.append(string);
		} {
 			sb.append(string);
		} sb.append(string) sb.append sb string System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb 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();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;



public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();

		List<String> strlist = new ArrayList<String>();

 		for (int i = 0; i < N; i++) {
			strlist.add(sc.next());
		}
 		Collections.sort(strlist);
 		StringBuilder sb = new StringBuilder();
 		for (String string : strlist) {
 			sb.append(string);
		}

 		System.out.println(sb.toString());

	}

}