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();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	}
} 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();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =  sc.nextInt();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N =  sc.nextInt();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N =  sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc String s[] = new String[N]; s new String[N] N for (int i=0;i<N;i++) {
			s[i] = sc.next();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			s[i] = sc.next();
		} {
			s[i] = sc.next();
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc Arrays.parallelSort(s) Arrays.parallelSort 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(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) {
		Scanner sc = new Scanner(System.in);
		int N =  sc.nextInt();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =  sc.nextInt();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	}
} 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();
		sc.nextInt();
		String s[] = new String[N];
		for (int i=0;i<N;i++) {
			s[i] = sc.next();
		}
		Arrays.parallelSort(s);
		for (int i=0;i<N;i++) {
			System.out.print(s[i]);
		}
	}
}