import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	}

} Main public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line[]=br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n =Integer.parseInt(line[0]); n Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 String [] sort =new String[n]; sort new String[n] n for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		} int i = 0; int i = 0; i 0 i < sort.length i sort.length sort sort.length i++ i++ i {
			sort[i] = br.readLine();
		} {
			sort[i] = br.readLine();
		} sort[i] = br.readLine() sort[i] sort i br.readLine() br.readLine br Arrays.sort(sort) Arrays.sort Arrays sort StringBuilder answer =new StringBuilder(); answer new StringBuilder() for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		} int i=0; int i=0; i 0 i<sort.length i sort.length sort sort.length i++ i++ i {
		answer.append(sort[i]);
		} {
		answer.append(sort[i]);
		} answer.append(sort[i]) answer.append answer sort[i] sort 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) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line[]=br.readLine().split(" ");
		int n =Integer.parseInt(line[0]);
		String [] sort =new String[n];

		for (int i = 0; i < sort.length; i++) {
			sort[i] = br.readLine();
		}

		Arrays.sort(sort);

		StringBuilder answer =new StringBuilder();

		for(int i=0;i<sort.length;i++) {
		answer.append(sort[i]);
		}

		System.out.println(answer);
	}

}
