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

public class Main {
	public static void main(String[] args) throws Exception {
		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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	}
} Main public static void main(String[] args) throws Exception {
		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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	} 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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	} 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 for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			System.out.print(input[i]);
		} {
			System.out.print(input[i]);
		} System.out.print(input[i]) System.out.print System.out System System.out input[i] input i String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		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);
		for (int i = 0; i < N; i++) {
			System.out.print(input[i]);
		}
	}
}