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

public class Main {

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

		int nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	}

} 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 nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	}

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

		int nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	} main {
		Scanner scan = new Scanner(System.in);

		int nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int nagasa = scan.nextInt(); nagasa scan.nextInt() scan.nextInt scan int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int i = 0; i 0 String a = ""; a "" String[] ary = new String[nagasa]; ary new String[nagasa] nagasa for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		} i = 0; i = 0 i 0 i < nagasa i nagasa i++ i++ i {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		} {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		} ary[i] = scan.next() ary[i] ary i scan.next() scan.next scan Arrays.sort(ary) Arrays.sort Arrays ary i = 0 i 0 for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		} i = 0; i = 0 i 0 i < nagasa i nagasa i++ i++ i {
			a = a + ary[i];

			//System.out.println(a);

		} {
			a = a + ary[i];

			//System.out.println(a);

		} a = a + ary[i] a a + ary[i] a ary[i] ary i System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {

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

		int nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	}

} public class Main {

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

		int nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	}

} 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 nagasa = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		String a = "";

		String[] ary = new String[nagasa];

		for (i = 0; i < nagasa; i++) {
			ary[i] = scan.next();
			//System.out.print(ary[i]);

		}

		Arrays.sort(ary);

		i = 0;

		for (i = 0; i < nagasa; i++) {
			a = a + ary[i];

			//System.out.println(a);

		}

		System.out.println(a);

	}

}