

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main{
	public static void main(String args[]) throws Exception {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]) throws Exception {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	}

} Main public static void main(String args[]) throws Exception {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	} main {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N= sc.nextInt(); N sc.nextInt() sc.nextInt sc int L= sc.nextInt(); L sc.nextInt() sc.nextInt sc ArrayList<String> Line = new ArrayList<String>(); Line new ArrayList<String>() for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		} int i = 0; int i = 0; i 0 i < N +1 i N +1 N 1 i++ i++ i {
				Line.add(sc.nextLine());
		} {
				Line.add(sc.nextLine());
		} Line.add(sc.nextLine()) Line.add Line sc.nextLine() sc.nextLine sc Collections.sort(Line) Collections.sort Collections Line for (String line : Line) {
			System.out.print(line);

		} String line Line {
			System.out.print(line);

		} {
			System.out.print(line);

		} System.out.print(line) System.out.print System.out System System.out line String args[] args public class Main{
	public static void main(String args[]) throws Exception {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	}

} public class Main{
	public static void main(String args[]) throws Exception {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	}

} Main


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main{
	public static void main(String args[]) throws Exception {

		
		Scanner sc = new Scanner(System.in);
		int N= sc.nextInt();
		int L= sc.nextInt();
		ArrayList<String> Line = new ArrayList<String>();

		for(int i = 0;i < N +1;i++) {
				Line.add(sc.nextLine());
		}
		Collections.sort(Line)

		;
		for (String line : Line) {
			System.out.print(line);

		}


	}

}
