import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void Solver(int numberOfString,int lengthOfString,String[] arr)
    {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void Solver(int numberOfString,int lengthOfString,String[] arr)
    {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    }
} Main public static void Solver(int numberOfString,int lengthOfString,String[] arr)
    {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    } Solver {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    } Arrays.sort(arr) Arrays.sort Arrays arr String k = ""; k "" for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
            k += arr[i];
        } {
            k += arr[i];
        } k += arr[i] k arr[i] arr i System.out.println(k) System.out.println System.out System System.out k int numberOfString numberOfString int lengthOfString lengthOfString String[] arr arr public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    } main {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int numberOfString = input.nextInt(); numberOfString input.nextInt() input.nextInt input int lengthOfStrings = input.nextInt(); lengthOfStrings input.nextInt() input.nextInt input String[] arr = new String[numberOfString]; arr new String[numberOfString] numberOfString String temp; temp for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        } int i = 0; int i = 0; i 0 i < numberOfString i numberOfString i++ i++ i {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        } {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        } temp = input.next() temp input.next() input.next input if(temp.length() == lengthOfStrings)
                arr[i] = temp; temp.length() == lengthOfStrings temp.length() temp.length temp lengthOfStrings arr[i] = temp arr[i] arr i temp Solver(numberOfString,lengthOfStrings,arr) Solver numberOfString lengthOfStrings arr String[] args args public class Main {

    public static void Solver(int numberOfString,int lengthOfString,String[] arr)
    {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    }
} public class Main {

    public static void Solver(int numberOfString,int lengthOfString,String[] arr)
    {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void Solver(int numberOfString,int lengthOfString,String[] arr)
    {
        Arrays.sort(arr);
        String k = "";
        for (int i = 0; i < arr.length; i++) {
            k += arr[i];
        }
        System.out.println(k);
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numberOfString = input.nextInt();
        int lengthOfStrings = input.nextInt();
        String[] arr = new String[numberOfString];
        String temp;
        for (int i = 0; i < numberOfString; i++) {
            temp = input.next();
            if(temp.length() == lengthOfStrings)
                arr[i] = temp;
        }
        Solver(numberOfString,lengthOfStrings,arr);
    }
}
