import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] line = sc.nextLine().split(" "); line sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int n = Integer.parseInt(line[0]); n Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 List<String> list = new ArrayList<String>(); list new ArrayList<String>() String min = ""; min "" for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			list.add(sc.nextLine());
		} {
			list.add(sc.nextLine());
		} list.add(sc.nextLine()) list.add list sc.nextLine() sc.nextLine sc sc.close() sc.close sc Collections.sort(list) Collections.sort Collections list for(String col:list) {
			min += col;
		} String col list {
			min += col;
		} {
			min += col;
		} min += col min col System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n = Integer.parseInt(line[0]);
		
		List<String> list = new ArrayList<String>();

		String min = "";
		
		for(int i=0;i<n;i++){
			list.add(sc.nextLine());
		}
		sc.close();
		
		Collections.sort(list);
		for(String col:list) {
			min += col;
		}
		System.out.println(min);
	}
}