import java.util.*;
import java.util.ArrayList;
import java.util.Collections;

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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        }
    }
} import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        }
    }
} 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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        }
    } 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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[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 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 Arrays.sort(S) Arrays.sort Arrays S for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        } int i = 0; int i = 0; i 0 i < n i n 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 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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        }
    }
} 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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        }
    }
} Main
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;

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();
        }
        Arrays.sort(S);
        for(int i = 0; i < n; i++){
            System.out.print(S[i]);
        }
    }
}