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);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    }
}        
        

 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);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    }
} 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);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    } exec {
        Scanner scanner = new Scanner(System.in);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) List<String> wordList = new ArrayList<>(); wordList new ArrayList<>() int j = scanner.nextInt(); j scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        } int i = 0; int i = 0; i 0 i <= j i j i++ i++ i {
            String input = scanner.nextLine();
            wordList.add(input);
        } {
            String input = scanner.nextLine();
            wordList.add(input);
        } String input = scanner.nextLine(); input scanner.nextLine() scanner.nextLine scanner wordList.add(input) wordList.add wordList input Collections.sort(wordList) Collections.sort Collections wordList for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        } int i = 0; int i = 0; i 0 i <= j i j i++ i++ i {
            System.out.print(wordList.get(i));
        } {
            System.out.print(wordList.get(i));
        } System.out.print(wordList.get(i)) System.out.print System.out System System.out wordList.get(i) wordList.get wordList i public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    
    private void exec() {
        Scanner scanner = new Scanner(System.in);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.exec();
    }

    
    private void exec() {
        Scanner scanner = new Scanner(System.in);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    }
} 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);
        List<String> wordList = new ArrayList<>();
        int j = scanner.nextInt();
        int k = scanner.nextInt();
        
        for (int i = 0; i <= j; i++) {
            String input = scanner.nextLine();
            wordList.add(input);
        }
        Collections.sort(wordList);
        for (int i = 0; i <= j; i++) {
            System.out.print(wordList.get(i));
        }
    }
}        
        


