import java.util.Arrays;
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();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.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 sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int l = sc.nextInt();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int l = sc.nextInt();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int l = sc.nextInt();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.close();
	} 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 String[] input = new String[n]; input new String[n] n for (int i=0; i<n; i++) {
			input[i] = sc.next();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			input[i] = sc.next();
		} {
			input[i] = sc.next();
		} input[i] = sc.next() input[i] input i sc.next() sc.next sc Arrays.sort(input) Arrays.sort Arrays input String result = ""; result "" for (int j=0; j<n; j++) {
			result += input[j];
		} int j=0; int j=0; j 0 j<n j n j++ j++ j {
			result += input[j];
		} {
			result += input[j];
		} result += input[j] result input[j] input j System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc 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();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int l = sc.nextInt();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.close();
	}

} 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 n = sc.nextInt();
		int l = sc.nextInt();
		
		String[] input = new String[n];
		
		for (int i=0; i<n; i++) {
			input[i] = sc.next();
		}
		
		Arrays.sort(input);
		
		String result = "";
		for (int j=0; j<n; j++) {
			result += input[j];
		}
		
		System.out.println(result);
		sc.close();
	}

}