import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	}
} import java.util.Arrays; Arrays 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 = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc String[] str = new String[n]; str new String[n] n for(int i=0; i<n; i++){
			str[i] = sc.next();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			str[i] = sc.next();
		} {
			str[i] = sc.next();
		} str[i] = sc.next() str[i] str i sc.next() sc.next sc Arrays.sort(str) Arrays.sort Arrays str String res = ""; res "" for(int i=0; i<n; i++){
			res += str[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			res += str[i];
		} {
			res += str[i];
		} res += str[i] res str[i] str i sc.close() sc.close sc System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		String[] str = new String[n];
		for(int i=0; i<n; i++){
			str[i] = sc.next();
		}
		Arrays.sort(str);
		String res = "";
		for(int i=0; i<n; i++){
			res += str[i];
		}
		sc.close();
		System.out.println(res);
	}
}