import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        }
}
//ここに一言添えます
//焼き鳥おいしいですよね import java.util.*; util.* java public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        }
} Main public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        } main {
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        } 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[] s = new String[n]; s new String[n] n for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
                        s[i] = sc.next();
                } {
                        s[i] = sc.next();
                } s[i] = sc.next() s[i] s i sc.next() sc.next sc sc.close() sc.close sc Arrays.sort(s) Arrays.sort Arrays s for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                } int i = 0 ; int i = 0 ; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
                        System.out.print(s[i]);
                } {
                        System.out.print(s[i]);
                } System.out.print(s[i]) System.out.print System.out System System.out s[i] s i System.out.println(s[n - 1]) System.out.println System.out System System.out s[n - 1] s n - 1 n 1 String[] args args public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        }
} public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        }
} Main
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int l = sc.nextInt();
                String[] s = new String[n];
                for(int i = 0 ; i < n ; i++){
                        s[i] = sc.next();
                }
                sc.close();
                Arrays.sort(s);
                for(int i = 0 ; i < n - 1 ; i++){
                        System.out.print(s[i]);
                }
                System.out.println(s[n - 1]);
        }
}
//ここに一言添えます
//焼き鳥おいしいですよね