import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.stream.Collectors; Collectors java.util.stream public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int l = in.nextInt(); l in.nextInt() in.nextInt in List<String> strings = new ArrayList<>(); strings new ArrayList<>() for (int i = 0; i < n; i++) {
            strings.add(in.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            strings.add(in.next());
        } {
            strings.add(in.next());
        } strings.add(in.next()) strings.add strings in.next() in.next in Collections.sort(strings) Collections.sort Collections strings System.out.println(strings.stream().collect(Collectors.joining())) System.out.println System.out System System.out strings.stream().collect(Collectors.joining()) strings.stream().collect strings.stream() strings.stream strings Collectors.joining() Collectors.joining Collectors String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            strings.add(in.next());
        }
        Collections.sort(strings);
        System.out.println(strings.stream().collect(Collectors.joining()));
    }
}
