import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        }
        Arrays.sort(S);
        for(int i = 0; i < N; i++) {
            System.out.print(S[i]);
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        }
        Arrays.sort(S);
        for(int i = 0; i < N; i++) {
            System.out.print(S[i]);
        }
    }
} Main public static void main(String[] args){
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        }
        Arrays.sort(S);
        for(int i = 0; i < N; i++) {
            System.out.print(S[i]);
        }
    } run {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        }
        Arrays.sort(S);
        for(int i = 0; i < N; i++) {
            System.out.print(S[i]);
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int L = scanner.nextInt(); L scanner.nextInt() scanner.nextInt scanner String[] S = new String[N]; S new String[N] N for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            S[i] = scanner.next();
        } {
            S[i] = scanner.next();
        } S[i] = scanner.next() S[i] S i scanner.next() scanner.next scanner 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 public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.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){
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        }
        Arrays.sort(S);
        for(int i = 0; i < N; i++) {
            System.out.print(S[i]);
        }
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int L = scanner.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++) {
            S[i] = scanner.next();
        }
        Arrays.sort(S);
        for(int i = 0; i < N; i++) {
            System.out.print(S[i]);
        }
    }
}