import java.util.Arrays;
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
} Main static Scanner scanner; scanner public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	} main {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	} scanner = new Scanner(System.in) scanner new Scanner(System.in) int N= gi(); N gi() gi int L= gi(); L gi() gi String[] S= new String[N]; S new String[N] N for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
	    	S[i]=gs();
	    } {
	    	S[i]=gs();
	    } S[i]=gs() S[i] S i gs() gs Arrays.parallelSort(S) Arrays.parallelSort Arrays S StringBuilder sb= new StringBuilder(); sb new StringBuilder() for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
	    	sb.append(S[i]);
	    } {
	    	sb.append(S[i]);
	    } sb.append(S[i]) sb.append sb S[i] S i System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb String[] args args // 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	} gs {
		return scanner.next();
	} return scanner.next(); scanner.next() scanner.next scanner // intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	} gi {
		return Integer.parseInt(scanner.next());
	} return Integer.parseInt(scanner.next()); Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner // longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	} gl {
		return Long.parseLong(scanner.next());
	} return Long.parseLong(scanner.next()); Long.parseLong(scanner.next()) Long.parseLong Long scanner.next() scanner.next scanner public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
} public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N= gi();
	    int L= gi();
	    String[] S= new String[N];
	    
	    for (int i=0; i<N;i++) {
	    	S[i]=gs();
	    }

	    Arrays.parallelSort(S);

	    StringBuilder sb= new StringBuilder();
	    for (int i=0; i<N;i++) {
	    	sb.append(S[i]);
	    }	    
        System.out.print(sb.toString());
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }

	   
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
}