import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    } 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 List<String> s = new ArrayList<String>(); s new ArrayList<String>() for (int i = 0; i < n; i++) {
            s.add(sc.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s.add(sc.next());
        } {
            s.add(sc.next());
        } s.add(sc.next()) s.add s sc.next() sc.next sc Collections.sort(s) Collections.sort Collections s for (String a : s) {
            System.out.print(a);
        } String a s {
            System.out.print(a);
        } {
            System.out.print(a);
        } System.out.print(a) System.out.print System.out System System.out a System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        List<String> s = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s.add(sc.next());
        }
        Collections.sort(s);
        for (String a : s) {
            System.out.print(a);
        }
        System.out.println();
    }
}
