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 ss[] = new String[n];
        for (int i = 0; i < n; i++) {
            ss[i] = scan.next();
        }

        Arrays.sort(ss);
        for (int i = 0; i < n; i++) {
            System.out.print(ss[i]);
        }
    }
} 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 ss[] = new String[n];
        for (int i = 0; i < n; i++) {
            ss[i] = scan.next();
        }

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

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

        Arrays.sort(ss);
        for (int i = 0; i < n; i++) {
            System.out.print(ss[i]);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();

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

        Arrays.sort(ss);
        for (int i = 0; i < n; i++) {
            System.out.print(ss[i]);
        }
    } 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 ss[] = new String[n]; ss new String[n] n for (int i = 0; i < n; i++) {
            ss[i] = scan.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            ss[i] = scan.next();
        } {
            ss[i] = scan.next();
        } ss[i] = scan.next() ss[i] ss i scan.next() scan.next scan Arrays.sort(ss) Arrays.sort Arrays ss for (int i = 0; i < n; i++) {
            System.out.print(ss[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            System.out.print(ss[i]);
        } {
            System.out.print(ss[i]);
        } System.out.print(ss[i]) System.out.print System.out System System.out ss[i] ss i 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 ss[] = new String[n];
        for (int i = 0; i < n; i++) {
            ss[i] = scan.next();
        }

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

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

        Arrays.sort(ss);
        for (int i = 0; i < n; i++) {
            System.out.print(ss[i]);
        }
    }
} 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 ss[] = new String[n];
        for (int i = 0; i < n; i++) {
            ss[i] = scan.next();
        }

        Arrays.sort(ss);
        for (int i = 0; i < n; i++) {
            System.out.print(ss[i]);
        }
    }
}
