
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int l = in.nextInt(); l in.nextInt() in.nextInt in in.nextLine() in.nextLine in String[] a = new String[n]; a new String[n] n for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        } int i = 0; int i = 0; i 0 i <a.length i a.length a a.length i++ i++ i {
            a[i]=in.nextLine();
        } {
            a[i]=in.nextLine();
        } a[i]=in.nextLine() a[i] a i in.nextLine() in.nextLine in for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        } int i = 0; int i = 0; i 0 i < a.length - 1 i a.length - 1 a.length a a.length 1 i++ i++ i {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        } {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        } for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            } int j = i + 1; int j = i + 1; j i + 1 i 1 j < a.length j a.length a a.length j++ j++ j {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            } {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            } if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                } a[i].compareTo(a[j]) > 0 a[i].compareTo(a[j]) a[i].compareTo a[i] a i a[j] a j 0 {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                } String tmp = a[i]; tmp a[i] a i a[i] = a[j] a[i] a i a[j] a j a[j] = tmp a[j] a j tmp for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        } int i = 0; int i = 0; i 0 i <a.length i a.length a a.length i++ i++ i {
            System.out.print(a[i]);
        } {
            System.out.print(a[i]);
        } System.out.print(a[i]) System.out.print System.out System System.out a[i] a i String[] args args public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    }
} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int l = in.nextInt();
        in.nextLine();
        String[] a = new String[n];
        //inputs
        for (int i = 0; i <a.length ; i++) {
            a[i]=in.nextLine();
        }
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareTo(a[j]) > 0) {
                    String tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }

        for (int i = 0; i <a.length ; i++) {
            System.out.print(a[i]);
        }




    }
}