import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	}

} import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int L = scanner.nextInt(); L scanner.nextInt() scanner.nextInt scanner String[] S = new String[N]; S new String[N] N Map<String, String> map = new TreeMap<String,String>(); map new TreeMap<String,String>() for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		} {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		} S[i] = scanner.next() S[i] S i scanner.next() scanner.next scanner if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			} map.get(S[i])==null map.get(S[i]) map.get map S[i] S i null {
				map.put(S[i], S[i]);
			} map.put(S[i], S[i]) map.put map S[i] S i S[i] S i {
				map.put(S[i]+i, S[i]);
			} map.put(S[i]+i, S[i]) map.put map S[i]+i S[i] S i i S[i] S i L=L+1 L L+1 L 1 for(String s:map.values()) {
			System.out.print(s);
		} String s map.values() map.values map {
			System.out.print(s);
		} {
			System.out.print(s);
		} System.out.print(s) System.out.print System.out System System.out s System.out.println() System.out.println System.out System System.out scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	}

} Main
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		String[] S = new String[N];
		Map<String, String> map = new TreeMap<String,String>();
		for(int i=0;i<N;i++) {
			S[i] = scanner.next();
			if(map.get(S[i])==null) {
				map.put(S[i], S[i]);
			}
			else {
				map.put(S[i]+i, S[i]);
			}
		}
		L=L+1;
		for(String s:map.values()) {
			System.out.print(s);
		}
		System.out.println();
		scanner.close();
	}

}
