import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.next();
		}
      	Arrays.sort(s);
      	for(int i=0; i<n; i++) System.out.print(s[i]);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.next();
		}
      	Arrays.sort(s);
      	for(int i=0; i<n; i++) System.out.print(s[i]);
	}
} Main public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.next();
		}
      	Arrays.sort(s);
      	for(int i=0; i<n; i++) System.out.print(s[i]);
	} main {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.next();
		}
      	Arrays.sort(s);
      	for(int i=0; i<n; i++) System.out.print(s[i]);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn int l = scn.nextInt(); l scn.nextInt() scn.nextInt scn String[] s = new String[n]; s new String[n] n for(int i=0; i<n; i++){
			s[i] = scn.next();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			s[i] = scn.next();
		} {
			s[i] = scn.next();
		} s[i] = scn.next() s[i] s i scn.next() scn.next scn 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 System.out System System.out s[i] s i String[] args args public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.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) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.next();
		}
      	Arrays.sort(s);
      	for(int i=0; i<n; i++) System.out.print(s[i]);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		String[] s = new String[n];
		for(int i=0; i<n; i++){
			s[i] = scn.next();
		}
      	Arrays.sort(s);
      	for(int i=0; i<n; i++) System.out.print(s[i]);
	}
}