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

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    } @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
        } {
            s[i] = sc.next();
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        } {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        } System.out.print(s[i]) System.out.print System.out System System.out s[i] s i if (i == n - 1) {
                System.out.print("\n");
            } i == n - 1 i n - 1 n 1 {
                System.out.print("\n");
            } System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    }

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

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0 ; i < n ; i++) {
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for (int i = 0 ; i < n ; i++) {
            System.out.print(s[i]);
            if (i == n - 1) {
                System.out.print("\n");
            }
        }
    }

}
