	
	import java.math.BigInteger;
import java.util.PriorityQueue;
import java.util.Scanner;
	
	class Main {
		public static void main(String args[]) {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int l = sc.nextInt();
			
			PriorityQueue<String> list = new PriorityQueue<>();
			for (int i = 0; i < n; i++) {
				list.add(sc.next());
			}
			
			for (int i = 0; i < n; i++) {
				System.out.print(list.poll());
			}
			
		}
	} import java.math.BigInteger; BigInteger java.math import java.util.PriorityQueue; PriorityQueue java.util import java.util.Scanner; Scanner java.util class Main {
		public static void main(String args[]) {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int l = sc.nextInt();
			
			PriorityQueue<String> list = new PriorityQueue<>();
			for (int i = 0; i < n; i++) {
				list.add(sc.next());
			}
			
			for (int i = 0; i < n; i++) {
				System.out.print(list.poll());
			}
			
		}
	} Main public static void main(String args[]) {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int l = sc.nextInt();
			
			PriorityQueue<String> list = new PriorityQueue<>();
			for (int i = 0; i < n; i++) {
				list.add(sc.next());
			}
			
			for (int i = 0; i < n; i++) {
				System.out.print(list.poll());
			}
			
		} main {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int l = sc.nextInt();
			
			PriorityQueue<String> list = new PriorityQueue<>();
			for (int i = 0; i < n; i++) {
				list.add(sc.next());
			}
			
			for (int i = 0; i < n; i++) {
				System.out.print(list.poll());
			}
			
		} 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 PriorityQueue<String> list = new PriorityQueue<>(); list new PriorityQueue<>() 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 for (int i = 0; i < n; i++) {
				System.out.print(list.poll());
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				System.out.print(list.poll());
			} {
				System.out.print(list.poll());
			} System.out.print(list.poll()) System.out.print System.out System System.out list.poll() list.poll list String args[] args
	
	import java.math.BigInteger;
import java.util.PriorityQueue;
import java.util.Scanner;
	
	class Main {
		public static void main(String args[]) {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int l = sc.nextInt();
			
			PriorityQueue<String> list = new PriorityQueue<>();
			for (int i = 0; i < n; i++) {
				list.add(sc.next());
			}
			
			for (int i = 0; i < n; i++) {
				System.out.print(list.poll());
			}
			
		}
	}