import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.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 keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.close();	
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.close();	
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.close();	
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int N = keyboard.nextInt(); N keyboard.nextInt() keyboard.nextInt keyboard int L = keyboard.nextInt(); L keyboard.nextInt() keyboard.nextInt keyboard String[] SI = new String[N]; SI new String[N] N for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		} int i = 0; int i = 0; i 0 i < N i N i ++ i ++ i {
			SI[i] = keyboard.next();
		} {
			SI[i] = keyboard.next();
		} SI[i] = keyboard.next() SI[i] SI i keyboard.next() keyboard.next keyboard Arrays.sort(SI) Arrays.sort Arrays SI for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		} int i = 0; int i = 0; i 0 i < N i N i ++ i ++ i {
			System.out.print(SI[i]);
		} {
			System.out.print(SI[i]);
		} System.out.print(SI[i]) System.out.print System.out System System.out SI[i] SI i keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.close();	
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.close();	
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int L = keyboard.nextInt();
		
		String[] SI = new String[N];
		
		for(int i = 0; i < N; i ++) {
			SI[i] = keyboard.next();
		}
		
		Arrays.sort(SI);
		
		for(int i = 0; i < N; i ++) {
			System.out.print(SI[i]);
		}
		keyboard.close();	
	}
}