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