import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.stream.Collectors; Collectors java.util.stream public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	} 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[] strArray = new String[N]; strArray new String[N] N for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < strArray.length i strArray.length strArray strArray.length i++ i++ i {
			strArray[i] = sc.next();
		} {
			strArray[i] = sc.next();
		} strArray[i] = sc.next() strArray[i] strArray i sc.next() sc.next sc Arrays.sort(strArray) Arrays.sort Arrays strArray System.out.println(Arrays.stream(strArray).collect(Collectors.joining())) System.out.println System.out System System.out Arrays.stream(strArray).collect(Collectors.joining()) Arrays.stream(strArray).collect Arrays.stream(strArray) Arrays.stream Arrays strArray Collectors.joining() Collectors.joining Collectors sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		String[] strArray = new String[N];
		for (int i = 0; i < strArray.length; i++) {
			strArray[i] = sc.next();
		}
		Arrays.sort(strArray);
		System.out.println(Arrays.stream(strArray).collect(Collectors.joining()));
		sc.close();
	}
}