import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
	
	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
	
	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	} _main {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	} Scanner sc = new Scanner(in); sc new Scanner(in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int L = sc.nextInt(); L sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N for(int i=0;i<N;i++) {
			S[i] = sc.next();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			S[i] = sc.next();
		} {
			S[i] = sc.next();
		} S[i] = sc.next() S[i] S i sc.next() sc.next sc sc.close() sc.close sc Arrays.sort(S) Arrays.sort Arrays S for(int i=0;i<N;i++) {
			out.print(S[i]);
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			out.print(S[i]);
		} {
			out.print(S[i]);
		} out.print(S[i]) out.print out S[i] S i out.println() out.println out String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args @SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} nextIntArray {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} int[] result = new int[n]; result new int[n] n for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			result[i] = sc.nextInt();
		} {
			result[i] = sc.nextInt();
		} result[i] = sc.nextInt() result[i] result i sc.nextInt() sc.nextInt sc return result; result Scanner sc sc int n n @SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} nextIntArray1origin {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} int[] result = new int[n + 1]; result new int[n + 1] n + 1 n 1 for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			result[i] = sc.nextInt();
		} {
			result[i] = sc.nextInt();
		} result[i] = sc.nextInt() result[i] result i sc.nextInt() sc.nextInt sc return result; result Scanner sc sc int n n public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
	
	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
	
	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int L = sc.nextInt();
		
		String[] S = new String[N];
		for(int i=0;i<N;i++) {
			S[i] = sc.next();
		}
		sc.close();

		Arrays.sort(S);
		
		for(int i=0;i<N;i++) {
			out.print(S[i]);
		}
		out.println();
		
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
	
	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
}
