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

public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    private void exec() {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    private void exec() {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    } main {
        Main main = new Main();
        main.exec();
    } Main main = new Main(); main new Main() main.exec() main.exec main String[] args args private void exec() {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    } exec {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int count = scanner.nextInt(); count scanner.nextInt() scanner.nextInt scanner scanner.nextLine() scanner.nextLine scanner List<String> words = new ArrayList<>(); words new ArrayList<>() for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        } int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
            words.add(scanner.nextLine());
        } {
            words.add(scanner.nextLine());
        } words.add(scanner.nextLine()) words.add words scanner.nextLine() scanner.nextLine scanner Collections.sort(words) Collections.sort Collections words StringBuilder result = new StringBuilder(); result new StringBuilder() for (String word : words) {
            result.append(word );
        } String word words {
            result.append(word );
        } {
            result.append(word );
        } result.append(word ) result.append result word System.out.println(result) System.out.println System.out System System.out result public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    private void exec() {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    }
} public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    private void exec() {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    private void exec() {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();

        List<String> words = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            words.add(scanner.nextLine());
        }
        Collections.sort(words);
        StringBuilder result = new StringBuilder();
        for (String word : words) {
            result.append(word );
        }
        System.out.println(result);
    }
}