
import java.util.*;

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

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    }

    public static String execute(int strNum, int strLen, List<String> strList) {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    }

    public static List<String> scanList(Scanner sc,int num){
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    }

    public static String execute(int strNum, int strLen, List<String> strList) {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    }

    public static List<String> scanList(Scanner sc,int num){
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    } main {

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int strNum = sc.nextInt(); strNum sc.nextInt() sc.nextInt sc int strLen = sc.nextInt(); strLen sc.nextInt() sc.nextInt sc List<String> strList = scanList(sc,strNum); strList scanList(sc,strNum) scanList sc strNum System.out.println(execute(strNum,strLen,strList)) System.out.println System.out System System.out execute(strNum,strLen,strList) execute strNum strLen strList String[] args args public static String execute(int strNum, int strLen, List<String> strList) {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    } execute {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    } strList.sort(Comparator.naturalOrder()) strList.sort strList Comparator.naturalOrder() Comparator.naturalOrder Comparator StringBuffer buf = new StringBuffer(); buf new StringBuffer() for(String str : strList){
            buf.append(str);
        } String str strList {
            buf.append(str);
        } {
            buf.append(str);
        } buf.append(str) buf.append buf str return buf.toString(); buf.toString() buf.toString buf int strNum strNum int strLen strLen List<String> strList strList public static List<String> scanList(Scanner sc,int num){
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    } scanList {
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    } List<String> scanList = new ArrayList<>(); scanList new ArrayList<>() for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        } int i = 0; int i = 0; i 0 i <= num i num i++ i++ i {
            scanList.add(sc.nextLine());
        } {
            scanList.add(sc.nextLine());
        } scanList.add(sc.nextLine()) scanList.add scanList sc.nextLine() sc.nextLine sc return scanList; scanList Scanner sc sc int num num public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    }

    public static String execute(int strNum, int strLen, List<String> strList) {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    }

    public static List<String> scanList(Scanner sc,int num){
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    }

    public static String execute(int strNum, int strLen, List<String> strList) {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    }

    public static List<String> scanList(Scanner sc,int num){
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    }
} Main

import java.util.*;

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

        Scanner sc = new Scanner(System.in);
        int strNum = sc.nextInt();
        int strLen = sc.nextInt();
        List<String> strList = scanList(sc,strNum);


        System.out.println(execute(strNum,strLen,strList));

    }

    public static String execute(int strNum, int strLen, List<String> strList) {
        strList.sort(Comparator.naturalOrder());
        StringBuffer buf = new StringBuffer();
        for(String str : strList){
            buf.append(str);
        }

        return buf.toString();
    }

    public static List<String> scanList(Scanner sc,int num){
        List<String> scanList = new ArrayList<>();
        for(int i = 0; i <= num ; i++){
            scanList.add(sc.nextLine());
        }
        return scanList;
    }
}
