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(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	}
	public static int sample(int n) {
		return n;
	}

} 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(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	}
	public static int sample(int n) {
		return n;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc L = sc.nextInt(); L sc.nextInt() sc.nextInt sc String[] array = new String[N]; array new String[N] N String buff=""; buff "" 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++) {
			buff+=array[i];
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			buff+=array[i];
		} {
			buff+=array[i];
		} buff+=array[i] buff array[i] array i System.out.println(buff) System.out.println System.out System System.out buff String[] args args public static int sample(int n) {
		return n;
	} sample {
		return n;
	} return n; n int n n public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	}
	public static int sample(int n) {
		return n;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	}
	public static int sample(int n) {
		return n;
	}

} 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(), L = sc.nextInt();
		String[] array = new String[N];
		String buff="";
		for(int i=0;i<N;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		for(int i=0;i<N;i++) {
			buff+=array[i];
		}

		System.out.println(buff);//Yes or YES注意

	}
	public static int sample(int n) {
		return n;
	}

}
