

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[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

		for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		}
		System.out.println();
	}
} 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[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

		for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		}
		System.out.println();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int l = sc.nextInt();

		String[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

		for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int l = sc.nextInt();

		String[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

		for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		}
		System.out.println();
	} 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[] array = new String[n]; array new String[n] n for(int i = 0; i < n; i++){
			array[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array[i] = sc.next();
		} {
			array[i] = sc.next();
		} array[i] = sc.next() array[i] array i sc.next() sc.next sc Arrays.sort(array) Arrays.sort Arrays array for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		} int i = 0; int i = 0; i 0 i < n i n 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 System.out.println() System.out.println System.out System System.out 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[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int l = sc.nextInt();

		String[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

		for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		}
		System.out.println();
	}
} 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[] array = new String[n];

		for(int i = 0; i < n; i++){
			array[i] = sc.next();
		}

		Arrays.sort(array);

		for(int i = 0; i < n; i++){
			System.out.print(array[i]);
		}
		System.out.println();
	}
}