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 = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	}
} 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 = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int L = Integer.parseInt(sc.next()); L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next 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 StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(String s : S) {
			sb.append(s);
		} String s S {
			sb.append(s);
		} {
			sb.append(s);
		} sb.append(s) sb.append sb s System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	}
} 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 = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		String[] S = new String[N];
		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
		}
		sc.close();
		Arrays.sort(S);
		StringBuilder sb = new StringBuilder();
		for(String s : S) {
			sb.append(s);
		}
		System.out.println(sb.toString());
	}
}