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 {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[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 {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[i];
		}
		System.out.println(answer);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[i];
		}
		System.out.println(answer);
	} main {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[i];
		}
		System.out.println(answer);
	} BufferedReader input =new BufferedReader (new InputStreamReader (System.in)); input new BufferedReader (new InputStreamReader (System.in)) String str = input.readLine( ); str input.readLine( ) input.readLine input String[] nl = str.split(" "); nl str.split(" ") str.split str " " int n = Integer.parseInt(nl[0]); n Integer.parseInt(nl[0]) Integer.parseInt Integer nl[0] nl 0 String[] list = new String[n]; list new String[n] n for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			list[i] = input.readLine( );
		} {
			list[i] = input.readLine( );
		} list[i] = input.readLine( ) list[i] list i input.readLine( ) input.readLine input Arrays.sort(list) Arrays.sort Arrays list String answer = ""; answer "" for(int i=0; i<n; i++){
			answer = answer + list[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			answer = answer + list[i];
		} {
			answer = answer + list[i];
		} answer = answer + list[i] answer answer + list[i] answer list[i] list 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 {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[i];
		}
		System.out.println(answer);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[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 {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] nl = str.split(" ");
		int n = Integer.parseInt(nl[0]);
		String[] list = new String[n];

		for(int i=0; i<n; i++){
			list[i] = input.readLine( );
		}
		Arrays.sort(list);
		String answer = "";
		for(int i=0; i<n; i++){
			answer = answer + list[i];
		}
		System.out.println(answer);
	}

}
