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

public class Main {

	public static void main (String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main (String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	}

} Main public static void main (String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	} main {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n=scan.nextInt() n scan.nextInt() scan.nextInt scan l=scan.nextInt(); l scan.nextInt() scan.nextInt scan ArrayList<String> dict = new ArrayList<String>(); dict new ArrayList<String>() for(int i=0; i<n; i++) {
			dict.add(scan.next());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			dict.add(scan.next());
		} {
			dict.add(scan.next());
		} dict.add(scan.next()) dict.add dict scan.next() scan.next scan Collections.sort(dict) Collections.sort Collections dict String result=""; result "" for(int i=0; i<n; i++) {
			result+=dict.get(i);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			result+=dict.get(i);
		} {
			result+=dict.get(i);
		} result+=dict.get(i) result dict.get(i) dict.get dict i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main (String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	}

} public class Main {

	public static void main (String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	}

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

public class Main {

	public static void main (String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt(),l=scan.nextInt();
		ArrayList<String> dict = new ArrayList<String>();
		for(int i=0; i<n; i++) {
			dict.add(scan.next());
		}
		Collections.sort(dict);
		String result="";
		for(int i=0; i<n; i++) {
			result+=dict.get(i);
		}
		System.out.println(result);
 	}

}