import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	} main {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int N = scn.nextInt(); N scn.nextInt() scn.nextInt scn String[] str = new String[N]; str new String[N] N int L = scn.nextInt(); L scn.nextInt() scn.nextInt scn for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			str[i] = scn.next();
		} {
			str[i] = scn.next();
		} str[i] = scn.next() str[i] str i scn.next() scn.next scn for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		} int i = 0; int i = 0; i 0 i < L i L ++i ++i i {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		} {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		} for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 j < N j N ++j ++j j {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			} {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			} if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				} str[i].compareTo(str[j]) > 0 str[i].compareTo(str[j]) str[i].compareTo str[i] str i str[j] str j 0 {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				} String temp = str[i]; temp str[i] str i str[i] = str[j] str[i] str i str[j] str j str[j] = temp str[j] str j temp Arrays.sort(str) Arrays.sort Arrays str String ans = ""; ans "" for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			ans = ans + str[i];
		} {
			ans = ans + str[i];
		} ans = ans + str[i] ans ans + str[i] ans str[i] str i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	}
} public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		String[] str = new String[N];
		int L = scn.nextInt();
		for (int i = 0; i < N; i++) {
			str[i] = scn.next();
		}
		for (int i = 0; i < L; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (str[i].compareTo(str[j]) > 0) {
					String temp = str[i];
					str[i] = str[j];
					str[j] = temp;
				}
			}
		}
		Arrays.sort(str);
		String ans = "";
		for (int i = 0; i < N; i++) {
			ans = ans + str[i];
		}
		System.out.println(ans);
	}
}