import java.util.*;

public class Main {
	public static void main(String[] args) {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	}
} Main public static void main(String[] args) {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	} main {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	} PriorityQueue<String> caca = new PriorityQueue<String>(); caca new PriorityQueue<String>() Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn int n2 = scn.nextInt(); n2 scn.nextInt() scn.nextInt scn for(int i = 0;i<n;i++)caca.add(scn.next()); int i = 0; int i = 0; i 0 i<n i n i++ i++ i caca.add(scn.next()); caca.add(scn.next()) caca.add caca scn.next() scn.next scn for(int i = 0;i<n;i++)System.out.print(caca.poll()); int i = 0; int i = 0; i 0 i<n i n i++ i++ i System.out.print(caca.poll()); System.out.print(caca.poll()) System.out.print System.out System System.out caca.poll() caca.poll caca System.out.println() System.out.println System.out System System.out scn.close() scn.close scn String[] args args public class Main {
	public static void main(String[] args) {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	}
} public class Main {
	public static void main(String[] args) {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		PriorityQueue<String> caca = new PriorityQueue<String>();
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int n2 = scn.nextInt();
		for(int i = 0;i<n;i++)caca.add(scn.next());
		for(int i = 0;i<n;i++)System.out.print(caca.poll());
		System.out.println();
		scn.close();
	}
}