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

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

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


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

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


    } main {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int l = scan.nextInt(); l scan.nextInt() scan.nextInt scan String a[] = new String[n]; a new String[n] n for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = scan.next();
        } {
            a[i] = scan.next();
        } a[i] = scan.next() a[i] a i scan.next() scan.next scan Arrays.sort(a) Arrays.sort Arrays a String res = ""; res "" for(int i = 0; i < n ;i++){
            res += a[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            res += a[i];
        } {
            res += a[i];
        } res += a[i] res a[i] a i System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


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

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


    }
} Main
import java.util.Arrays;
import java.util.Scanner;

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

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        String a[] = new String[n];

        for(int i = 0; i < n ;i++){
            a[i] = scan.next();
        }

        Arrays.sort(a);

        String res = "";

        for(int i = 0; i < n ;i++){
            res += a[i];
        }

        System.out.println(res);


    }
}
