
import java.util.*;

/**
 * @author mix
 */
public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    }

} Main public static void main(String[] args) {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    } main {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    } Scanner s1 = new Scanner(System.in); s1 new Scanner(System.in) int N = s1.nextInt(); N s1.nextInt() s1.nextInt s1 int L = s1.nextInt(); L s1.nextInt() s1.nextInt s1 String[] stringArray = new String[N]; stringArray new String[N] N for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            stringArray[i] = s1.next();
        } {
            stringArray[i] = s1.next();
        } stringArray[i] = s1.next() stringArray[i] stringArray i s1.next() s1.next s1 Arrays.sort(stringArray) Arrays.sort Arrays stringArray for (String s : stringArray) {
            System.out.print(s);
        } String s stringArray {
            System.out.print(s);
        } {
            System.out.print(s);
        } System.out.print(s) System.out.print System.out System System.out s System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    }

} public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    }

} Main

import java.util.*;

/**
 * @author mix
 */
public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s1 = new Scanner(System.in);
        int N = s1.nextInt();
        int L = s1.nextInt();
        String[] stringArray = new String[N];
        for (int i = 0; i < N; i++) {
            stringArray[i] = s1.next();
        }
        Arrays.sort(stringArray);
        for (String s : stringArray) {
            System.out.print(s);
        }
        System.out.println("");
    }

}
