import java.util.Scanner;

public class Main{
	
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	}
} import java.util.Scanner; Scanner java.util public class Main{
	
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	}
} Main public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	} main {
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String answer = ""; answer "" final int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan int len = scan.nextInt(); len scan.nextInt() scan.nextInt scan String[] words = new String[num]; words new String[num] num for(int i = 0; i < num; i++){
			words[i] = scan.next();
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			words[i] = scan.next();
		} {
			words[i] = scan.next();
		} words[i] = scan.next() words[i] words i scan.next() scan.next scan for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		} int i = 1; int i = 1; i 1 i < num i num i++ i++ i {
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		} {
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		} String temp = words[i]; temp words[i] words i int j = i - 1; j i - 1 i 1 while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			} j >= 0 && words[j].compareTo(temp) > 0 j >= 0 j 0 words[j].compareTo(temp) > 0 words[j].compareTo(temp) words[j].compareTo words[j] words j temp 0 {
				words[j + 1] = words[j];
				j--;
			} words[j + 1] = words[j] words[j + 1] words j + 1 j 1 words[j] words j j-- j words[j + 1] = temp words[j + 1] words j + 1 j 1 temp for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			answer = answer.concat(words[i]);
		} {
			answer = answer.concat(words[i]);
		} answer = answer.concat(words[i]) answer answer.concat(words[i]) answer.concat answer words[i] words i System.out.println(answer) System.out.println System.out System System.out answer String... args args public class Main{
	
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	}
} public class Main{
	
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	}
} Main
import java.util.Scanner;

public class Main{
	
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		final int num = scan.nextInt();
		int len = scan.nextInt();
		String[] words = new String[num];
		
		for(int i = 0; i < num; i++){
			words[i] = scan.next();
		}
		
		// ソート
		for(int i = 1; i < num; i++){
			String temp = words[i];
			int j = i - 1;
			while(j >= 0 && words[j].compareTo(temp) > 0){
				words[j + 1] = words[j];
				j--;
			}
			words[j + 1] = temp;
		}
		
		// 全単語の結合
		for(int i = 0; i < num; i++){
			answer = answer.concat(words[i]);
		}
		
		System.out.println(answer);
		
	}
}