import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    } main {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int L = Integer.parseInt(sc.next()); L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc List<String> array = new ArrayList<String>(); array new ArrayList<String>() for (int i=0; i<N; i++){
        	array.add(sc.next());
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        	array.add(sc.next());
        } {
        	array.add(sc.next());
        } array.add(sc.next()) array.add array sc.next() sc.next sc Collections.sort(array) Collections.sort Collections array for (String a : array) {
        	  System.out.print(a);
       } String a array {
        	  System.out.print(a);
       } {
        	  System.out.print(a);
       } System.out.print(a) System.out.print System.out System System.out a String[] args args public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    }
} public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());

        List<String> array = new ArrayList<String>();

        for (int i=0; i<N; i++){
        	array.add(sc.next());
        }

        Collections.sort(array);

        for (String a : array) {
        	  System.out.print(a);
       }
    }
}