import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args)  {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	}
	
}
 import java.util.*; util.* java import java.io.*; io.* java public class Main {
	public static void main(String[] args)  {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	}
	
} Main public static void main(String[] args)  {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	} main {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt() n in.nextInt() in.nextInt in m = in.nextInt(); m in.nextInt() in.nextInt in ArrayList<String> a = new ArrayList<>(n); a new ArrayList<>(n) for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		String y = in.next();
		a.add(y);
	} {
		String y = in.next();
		a.add(y);
	} String y = in.next(); y in.next() in.next in a.add(y) a.add a y Collections.sort(a) Collections.sort Collections a for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		System.out.print(a.get(i));
	} {
		System.out.print(a.get(i));
	} System.out.print(a.get(i)) System.out.print System.out System System.out a.get(i) a.get a i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args)  {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	}
	
} public class Main {
	public static void main(String[] args)  {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	}
	
} Main
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args)  {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt(),m = in.nextInt();;	
	ArrayList<String> a = new ArrayList<>(n);
	for (int i = 0; i < n; i++) {
		String y = in.next();
		a.add(y);
	}
	Collections.sort(a);	
	for (int i = 0; i < n; i++) {
		System.out.print(a.get(i));
	}	
	System.out.println();
		
	}
	
}

