import java.util.Arrays;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    }
} import java.util.Arrays; Arrays java.util import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    } 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 StringBuffer buff = new StringBuffer(); buff new StringBuffer() String a[] = new String[N]; a new String[N] N for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i] = sc.next();
        } {
            a[i] = sc.next();
        } a[i] = sc.next() a[i] a i sc.next() sc.next sc Arrays.sort(a) Arrays.sort Arrays a for(int i = 0;i < N;i++){
            buff.append(a[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            buff.append(a[i]);
        } {
            buff.append(a[i]);
        } buff.append(a[i]) buff.append buff a[i] a i System.out.println(buff) System.out.println System.out System System.out buff String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    }
} Main
import java.util.Arrays;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        StringBuffer buff = new StringBuffer();
        String a[] = new String[N];
        for(int i = 0;i < a.length;i++){
            a[i] = sc.next();
        }
        Arrays.sort(a);
        for(int i = 0;i < N;i++){
            buff.append(a[i]);
        }
        System.out.println(buff);
    }
}
