import java.util.*;
class Main{
        public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
        int s = sc.nextInt();
        List<String> res = new ArrayList();

        for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        }

        Collections.sort(res);
        StringBuffer ret = new StringBuffer();
        for(String a : res)
          ret.append(a);

        System.out.println(ret.toString());
    }
} import java.util.*; util.* java class Main{
        public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
        int s = sc.nextInt();
        List<String> res = new ArrayList();

        for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        }

        Collections.sort(res);
        StringBuffer ret = new StringBuffer();
        for(String a : res)
          ret.append(a);

        System.out.println(ret.toString());
    }
} Main public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
        int s = sc.nextInt();
        List<String> res = new ArrayList();

        for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        }

        Collections.sort(res);
        StringBuffer ret = new StringBuffer();
        for(String a : res)
          ret.append(a);

        System.out.println(ret.toString());
    } main {
        Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
        int s = sc.nextInt();
        List<String> res = new ArrayList();

        for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        }

        Collections.sort(res);
        StringBuffer ret = new StringBuffer();
        for(String a : res)
          ret.append(a);

        System.out.println(ret.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc List<String> res = new ArrayList(); res new ArrayList() for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
                res.add(sc.nextLine());
        } {
                res.add(sc.nextLine());
        } res.add(sc.nextLine()) res.add res sc.nextLine() sc.nextLine sc Collections.sort(res) Collections.sort Collections res StringBuffer ret = new StringBuffer(); ret new StringBuffer() for(String a : res)
          ret.append(a); String a res ret.append(a); ret.append(a) ret.append ret a System.out.println(ret.toString()) System.out.println System.out System System.out ret.toString() ret.toString ret String [] args args
import java.util.*;
class Main{
        public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
        int s = sc.nextInt();
        List<String> res = new ArrayList();

        for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        }

        Collections.sort(res);
        StringBuffer ret = new StringBuffer();
        for(String a : res)
          ret.append(a);

        System.out.println(ret.toString());
    }
}