import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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 = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int L = Integer.parseInt(sc.next()); L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for(int i = 0; i < N; i++) {
			list.add(sc.next());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			list.add(sc.next());
		} {
			list.add(sc.next());
		} list.add(sc.next()) list.add list sc.next() sc.next sc Collections.sort(list) Collections.sort Collections list sc.close() sc.close sc for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			System.out.print(list.get(i));
		} {
			System.out.print(list.get(i));
		} System.out.print(list.get(i)) System.out.print System.out System System.out list.get(i) list.get list i String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		Collections.sort(list);
		sc.close();
		for(int i = 0; i < N; i++) {
			System.out.print(list.get(i));
		}
	}

}
