import java.util.*;

public class Main {
    static long INF = 1000000000000000L;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    }
} import java.util.*; util.* java public class Main {
    static long INF = 1000000000000000L;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    }
} Main static long INF = 1000000000000000L; INF 1000000000000000L public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    } main {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc String[] array = new String[n]; array new String[n] n for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = sc.next();
        } {
            array[i] = sc.next();
        } array[i] = sc.next() array[i] array i sc.next() sc.next sc Arrays.sort(array) Arrays.sort Arrays array for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            System.out.print(array[i]);
        } {
            System.out.print(array[i]);
        } System.out.print(array[i]) System.out.print System.out System System.out array[i] array i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    static long INF = 1000000000000000L;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    }
} public class Main {
    static long INF = 1000000000000000L;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    }
} Main
import java.util.*;

public class Main {
    static long INF = 1000000000000000L;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextInt();
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }
        Arrays.sort(array);
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i]);
        }
        System.out.println();
    }
}