import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	} main {
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	} 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> inputs = new ArrayList<String>(); inputs new ArrayList<String>() for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			//get strings
			inputs.add(sc.next());
		} {
			//get strings
			inputs.add(sc.next());
		} inputs.add(sc.next()) inputs.add inputs sc.next() sc.next sc Collections.sort(inputs) Collections.sort Collections inputs String output = String.join("", inputs); output String.join("", inputs) String.join String "" inputs System.out.println(output) System.out.println System.out System System.out output String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get a integer
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		List<String> inputs = new ArrayList<String>();
		
		for (int i = 0; i < N; i++) {
			//get strings
			inputs.add(sc.next());
		}
		
		Collections.sort(inputs);
		
		String output = String.join("", inputs);
		// output
		System.out.println(output);
	}
}