import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Len = sc.nextInt();

		String data[] = new String[N];
		for (int i = 0; i < data.length; i++) {
			data[i] = sc.next();
		}
		for (int i = 0; i < data.length; i++) {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	}
		StringBuilder str = new StringBuilder();
		for (String s : data) {
			str.append(s);
		}

		System.out.println(str);
		sc.close();
	}
	static String[] change(String[] s, int a, int b){
		String temp;
			temp = s[a];
			s[a] = s[b];
			s[b] = temp;
		return s;
	}
} import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Len = sc.nextInt();

		String data[] = new String[N];
		for (int i = 0; i < data.length; i++) {
			data[i] = sc.next();
		}
		for (int i = 0; i < data.length; i++) {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	}
		StringBuilder str = new StringBuilder();
		for (String s : data) {
			str.append(s);
		}

		System.out.println(str);
		sc.close();
	}
	static String[] change(String[] s, int a, int b){
		String temp;
			temp = s[a];
			s[a] = s[b];
			s[b] = temp;
		return s;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Len = sc.nextInt();

		String data[] = new String[N];
		for (int i = 0; i < data.length; i++) {
			data[i] = sc.next();
		}
		for (int i = 0; i < data.length; i++) {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	}
		StringBuilder str = new StringBuilder();
		for (String s : data) {
			str.append(s);
		}

		System.out.println(str);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Len = sc.nextInt();

		String data[] = new String[N];
		for (int i = 0; i < data.length; i++) {
			data[i] = sc.next();
		}
		for (int i = 0; i < data.length; i++) {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	}
		StringBuilder str = new StringBuilder();
		for (String s : data) {
			str.append(s);
		}

		System.out.println(str);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int Len = sc.nextInt(); Len sc.nextInt() sc.nextInt sc String data[] = new String[N]; data new String[N] N for (int i = 0; i < data.length; i++) {
			data[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
			data[i] = sc.next();
		} {
			data[i] = sc.next();
		} data[i] = sc.next() data[i] data i sc.next() sc.next sc for (int i = 0; i < data.length; i++) {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	} int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	} {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	} for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			} int j = data.length -1; int j = data.length -1; j data.length -1 data.length data data.length 1 i < j i j j-- j-- j {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			} {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			} if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				} 0 >data[j].compareTo(data[j -1]) 0 data[j].compareTo(data[j -1]) data[j].compareTo data[j] data j data[j -1] data j -1 j 1 {
					data = change(data, j, j-1);
				} data = change(data, j, j-1) data change(data, j, j-1) change data j j-1 j 1 StringBuilder str = new StringBuilder(); str new StringBuilder() for (String s : data) {
			str.append(s);
		} String s data {
			str.append(s);
		} {
			str.append(s);
		} str.append(s) str.append str s System.out.println(str) System.out.println System.out System System.out str sc.close() sc.close sc String[] args args static String[] change(String[] s, int a, int b){
		String temp;
			temp = s[a];
			s[a] = s[b];
			s[b] = temp;
		return s;
	} change {
		String temp;
			temp = s[a];
			s[a] = s[b];
			s[b] = temp;
		return s;
	} String temp; temp temp = s[a] temp s[a] s a s[a] = s[b] s[a] s a s[b] s b s[b] = temp s[b] s b temp return s; s String[] s s int a a int b b
import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Len = sc.nextInt();

		String data[] = new String[N];
		for (int i = 0; i < data.length; i++) {
			data[i] = sc.next();
		}
		for (int i = 0; i < data.length; i++) {
			for (int j = data.length -1; i < j; j--) {
				if(0 >data[j].compareTo(data[j -1])){
					data = change(data, j, j-1);
				}
			}
	}
		StringBuilder str = new StringBuilder();
		for (String s : data) {
			str.append(s);
		}

		System.out.println(str);
		sc.close();
	}
	static String[] change(String[] s, int a, int b){
		String temp;
			temp = s[a];
			s[a] = s[b];
			s[b] = temp;
		return s;
	}
}
