import 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();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java 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();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    } 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 ArrayList<String> li = new ArrayList<String>(); li new ArrayList<String>() for(int i = 0; i < n; i++){
            li.add(sc.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            li.add(sc.next());
        } {
            li.add(sc.next());
        } li.add(sc.next()) li.add li sc.next() sc.next sc Collections.sort(li) Collections.sort Collections li String ans = ""; ans "" for(String s : li){
            ans += s;
        } String s li {
            ans += s;
        } {
            ans += s;
        } ans += s ans s System.out.println(ans) System.out.println System.out System System.out ans 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();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    }
} 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();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    }
} Main
import 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();
        ArrayList<String> li = new ArrayList<String>();
        for(int i = 0; i < n; i++){
            li.add(sc.next());
        }
        Collections.sort(li);
        String ans = "";
        for(String s : li){
            ans += s;
        }
        System.out.println(ans);
    }
}
