import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	}
} import java.util.Arrays; Arrays 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 num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	} main {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int len = sc.nextInt(); len sc.nextInt() sc.nextInt sc String dummy = sc.nextLine(); dummy sc.nextLine() sc.nextLine sc String[] array = new String[num]; array new String[num] num for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    } int i = 0; int i = 0; i 0 i<num i num i++ i++ i {
	        array[i] = sc.nextLine();
	    } {
	        array[i] = sc.nextLine();
	    } array[i] = sc.nextLine() array[i] array i sc.nextLine() sc.nextLine sc Arrays.sort(array) Arrays.sort Arrays array for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    } int i = 0; int i = 0; i 0 i<array.length i array.length array array.length i++ i++ i {
			System.out.print(array[i]);
	    } {
			System.out.print(array[i]);
	    } System.out.print(array[i]) System.out.print System.out System System.out array[i] array i String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int len = sc.nextInt();
		String dummy = sc.nextLine();

	    String[] array = new String[num];
	    for(int i = 0; i<num; i++){
	        array[i] = sc.nextLine();
	    }

	    Arrays.sort(array);
	    for(int i = 0; i<array.length; i++){
			System.out.print(array[i]);
	    }
	}
}
