import java.io.*;
import java.util.*;

public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
} Main static MyReader in = new MyReader(); in new MyReader() static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args){
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    } main {
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    } int N N L; L {int[] a = in.ii(); N = a[0]; L = a[1];} int[] a = in.ii(); a in.ii() in.ii in N = a[0] N a[0] a 0 L = a[1] L a[1] a 1 String[] S = new String[N]; S new String[N] N for(int i = 0; i < N; i++)
            S[i] = in.s(); int i = 0; int i = 0; i 0 i < N i N i++ i++ i S[i] = in.s(); S[i] = in.s() S[i] S i in.s() in.s in Arrays.sort(S) Arrays.sort Arrays S for(int i = 0; i < N; i++)
            out.print(S[i]); int i = 0; int i = 0; i 0 i < N i N i++ i++ i out.print(S[i]); out.print(S[i]) out.print out S[i] S i out.flush() out.flush out String[] args args static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    } MyReader MyReader(){
            super(new InputStreamReader(System.in));
        } MyReader {
            super(new InputStreamReader(System.in));
        } super(new InputStreamReader(System.in)) super new InputStreamReader(System.in) String s(){
            try{return readLine();}catch(IOException e){return "";}
        } s {
            try{return readLine();}catch(IOException e){return "";}
        } try{return readLine();}catch(IOException e){return "";} catch(IOException e){return "";} IOException e {return "";} return ""; "" {return readLine();} return readLine(); readLine() readLine String[] ss(){
            return s().split(" ");
        } ss {
            return s().split(" ");
        } return s().split(" "); s().split(" ") s().split s() s " " int i(){
            return Integer.parseInt(s());
        } i {
            return Integer.parseInt(s());
        } return Integer.parseInt(s()); Integer.parseInt(s()) Integer.parseInt Integer s() s int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        } ii {
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        } String[] ss = ss(); ss ss() ss int[] ii = new int[ss.length]; ii new int[ss.length] ss.length ss ss.length for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]); int j = 0; int j = 0; j 0 j < ss.length j ss.length ss ss.length j++ j++ j ii[j] = Integer.parseInt(ss[j]); ii[j] = Integer.parseInt(ss[j]) ii[j] ii j Integer.parseInt(ss[j]) Integer.parseInt Integer ss[j] ss j return ii; ii long l(){
            return Long.parseLong(s());
        } l {
            return Long.parseLong(s());
        } return Long.parseLong(s()); Long.parseLong(s()) Long.parseLong Long s() s long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        } ll {
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        } String[] ss = ss(); ss ss() ss long[] ll = new long[ss.length]; ll new long[ss.length] ss.length ss ss.length for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]); int j = 0; int j = 0; j 0 j < ss.length j ss.length ss ss.length j++ j++ j ll[j] = Long.parseLong(ss[j]); ll[j] = Long.parseLong(ss[j]) ll[j] ll j Long.parseLong(ss[j]) Long.parseLong Long ss[j] ss j return ll; ll BufferedReader public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
} public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
} Main
import java.io.*;
import java.util.*;

public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        int N, L;
        {int[] a = in.ii(); N = a[0]; L = a[1];}
        String[] S = new String[N];
        for(int i = 0; i < N; i++)
            S[i] = in.s();
        Arrays.sort(S);
        for(int i = 0; i < N; i++)
            out.print(S[i]);
        out.flush();
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}
