

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

class Main {
    public static void main(String[] args) throws IOException {
		
		// ** For submission. 
		Scanner sc = new Scanner(System.in);
		
		// Write your code here. 
		
        int n = sc.nextInt();
        int L = sc.nextInt();
        
        String[] strs = new String[n];
        for (int i = 0; i < n; i++) {
        	strs[i] = sc.next();
		}
        
        Arrays.sort(strs);
        
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
		}
        
        System.out.println(sb.toString());
        
    }
}




































 import java.io.*; io.* java import java.util.*; util.* java class Main {
    public static void main(String[] args) throws IOException {
		
		// ** For submission. 
		Scanner sc = new Scanner(System.in);
		
		// Write your code here. 
		
        int n = sc.nextInt();
        int L = sc.nextInt();
        
        String[] strs = new String[n];
        for (int i = 0; i < n; i++) {
        	strs[i] = sc.next();
		}
        
        Arrays.sort(strs);
        
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
		}
        
        System.out.println(sb.toString());
        
    }
} Main public static void main(String[] args) throws IOException {
		
		// ** For submission. 
		Scanner sc = new Scanner(System.in);
		
		// Write your code here. 
		
        int n = sc.nextInt();
        int L = sc.nextInt();
        
        String[] strs = new String[n];
        for (int i = 0; i < n; i++) {
        	strs[i] = sc.next();
		}
        
        Arrays.sort(strs);
        
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
		}
        
        System.out.println(sb.toString());
        
    } main {
		
		// ** For submission. 
		Scanner sc = new Scanner(System.in);
		
		// Write your code here. 
		
        int n = sc.nextInt();
        int L = sc.nextInt();
        
        String[] strs = new String[n];
        for (int i = 0; i < n; i++) {
        	strs[i] = sc.next();
		}
        
        Arrays.sort(strs);
        
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
		}
        
        System.out.println(sb.toString());
        
    } 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 String[] strs = new String[n]; strs new String[n] n for (int i = 0; i < n; i++) {
        	strs[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	strs[i] = sc.next();
		} {
        	strs[i] = sc.next();
		} strs[i] = sc.next() strs[i] strs i sc.next() sc.next sc Arrays.sort(strs) Arrays.sort Arrays strs StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
		} int i = 0; int i = 0; i 0 i < strs.length i strs.length strs strs.length i++ i++ i {
			sb.append(strs[i]);
		} {
			sb.append(strs[i]);
		} sb.append(strs[i]) sb.append sb strs[i] strs i System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args


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

class Main {
    public static void main(String[] args) throws IOException {
		
		// ** For submission. 
		Scanner sc = new Scanner(System.in);
		
		// Write your code here. 
		
        int n = sc.nextInt();
        int L = sc.nextInt();
        
        String[] strs = new String[n];
        for (int i = 0; i < n; i++) {
        	strs[i] = sc.next();
		}
        
        Arrays.sort(strs);
        
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
		}
        
        System.out.println(sb.toString());
        
    }
}





































