import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} Main public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } String line = br.readLine(); line br.readLine() br.readLine br String[] items = line.split("\\s+"); items line.split("\\s+") line.split line "\\s+" int N = Integer.parseInt(items[0]); N Integer.parseInt(items[0]) Integer.parseInt Integer items[0] items 0 int L = Integer.parseInt(items[1]); L Integer.parseInt(items[1]) Integer.parseInt Integer items[1] items 1 line = br.readLine() line br.readLine() br.readLine br List<String> list = new ArrayList<>(); list new ArrayList<>() while(line != null){
                list.add(line);
                line = br.readLine();
            } line != null line null {
                list.add(line);
                line = br.readLine();
            } list.add(line) list.add list line line = br.readLine() line br.readLine() br.readLine br Collections.sort(list) Collections.sort Collections list for(String s : list){
                System.out.print(s);
            } String s list {
                System.out.print(s);
            } {
                System.out.print(s);
            } System.out.print(s) System.out.print System.out System System.out s System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} public class Main {
    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line = br.readLine();
            String[] items = line.split("\\s+");
            int N = Integer.parseInt(items[0]);
            int L = Integer.parseInt(items[1]);

            line = br.readLine();
            List<String> list = new ArrayList<>();
            while(line != null){
                list.add(line);
                line = br.readLine();
            }
            Collections.sort(list);
            for(String s : list){
                System.out.print(s);
            }
            System.out.println();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}