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

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	}
} import java.util.Arrays; Arrays 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 count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	}
} Main public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	} main {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int count = scan.nextInt(); count scan.nextInt() scan.nextInt scan int strlenge = scan.nextInt(); strlenge scan.nextInt() scan.nextInt scan String[] output = new String[count]; output new String[count] count for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			 output[i] = scan.next();
		} {
			 output[i] = scan.next();
		} output[i] = scan.next() output[i] output i scan.next() scan.next scan Arrays.sort(output) Arrays.sort Arrays output for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			 System.out.print(output[i]);
		} {
			 System.out.print(output[i]);
		} System.out.print(output[i]) System.out.print System.out System System.out output[i] output i scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	}
} public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	}
}