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(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		sc.close();
	}	

} 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(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		sc.close();
	}	

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		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[] stvals = new String[N]; stvals new String[N] N for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			stvals[i] = sc.next();
		} {
			stvals[i] = sc.next();
		} stvals[i] = sc.next() stvals[i] stvals i sc.next() sc.next sc Arrays.sort(stvals) Arrays.sort Arrays stvals for(String s:stvals) {
			System.out.print(s);
		} String s stvals {
			System.out.print(s);
		} {
			System.out.print(s);
		} System.out.print(s) System.out.print System.out System System.out s System.out.println() System.out.println System.out System System.out sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		sc.close();
	}	

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		sc.close();
	}	

} 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(); //N個
		int L = sc.nextInt(); //長さL
		
		String[] stvals = new String[N];
		for(int i=0;i<N;i++) {
			stvals[i] = sc.next();
		}
		Arrays.sort(stvals);
		for(String s:stvals) {
			System.out.print(s);
		}
		System.out.println();
		
		sc.close();
	}	

}