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

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

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

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

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        List<String> li = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            li.add(s[i]);
        }
        Collections.sort(li);
        for (int i = 0; i < n; i++) {
            System.out.print(li.get(i));
        }
        System.out.println();

        sc.close();
    } 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 List<String> li = new ArrayList<String>(); li new ArrayList<String>() for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            li.add(s[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
            li.add(s[i]);
        } {
            s[i] = sc.next();
            li.add(s[i]);
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc li.add(s[i]) li.add li s[i] s i Collections.sort(li) Collections.sort Collections li for (int i = 0; i < n; i++) {
            System.out.print(li.get(i));
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            System.out.print(li.get(i));
        } {
            System.out.print(li.get(i));
        } System.out.print(li.get(i)) System.out.print System.out System System.out li.get(i) li.get li i System.out.println() System.out.println System.out System System.out sc.close() sc.close sc String[] args args
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

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

        sc.close();
    }
}