import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    } 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 sc.nextLine() sc.nextLine sc String S[] = new String[N]; S new String[N] N for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        } int i=0 ; int i=0 ; i 0 i< N i N i++ i++ i {
            S[i] = sc.nextLine();
        } {
            S[i] = sc.nextLine();
        } S[i] = sc.nextLine() S[i] S i sc.nextLine() sc.nextLine sc Arrays.sort(S) Arrays.sort Arrays S for(String i:S){
            System.out.print(i);
        } String i S {
            System.out.print(i);
        } {
            System.out.print(i);
        } System.out.print(i) System.out.print System.out System System.out i String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int L = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        
        for(int i=0 ; i< N ; i++){
            S[i] = sc.nextLine();
        }
        
        Arrays.sort(S);
        
        for(String i:S){
            System.out.print(i);
        }
    }
}
