import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

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

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