import java.util.*;
class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String str = scan.next();
    	int N = Integer.parseInt(str);
      	str = scan.next();
      	int L = Integer.parseInt(str);
      	ArrayList<String> list = new ArrayList<>();
      	
      	for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        }
      	
      	Collections.sort(list);
      	for(int i = 0; i < N ; i++){
        	String input = list.get(i);
          	System.out.print(input);
        }
    }
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String str = scan.next();
    	int N = Integer.parseInt(str);
      	str = scan.next();
      	int L = Integer.parseInt(str);
      	ArrayList<String> list = new ArrayList<>();
      	
      	for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        }
      	
      	Collections.sort(list);
      	for(int i = 0; i < N ; i++){
        	String input = list.get(i);
          	System.out.print(input);
        }
    }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String str = scan.next();
    	int N = Integer.parseInt(str);
      	str = scan.next();
      	int L = Integer.parseInt(str);
      	ArrayList<String> list = new ArrayList<>();
      	
      	for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        }
      	
      	Collections.sort(list);
      	for(int i = 0; i < N ; i++){
        	String input = list.get(i);
          	System.out.print(input);
        }
    } main {
    	Scanner scan = new Scanner(System.in);
      	String str = scan.next();
    	int N = Integer.parseInt(str);
      	str = scan.next();
      	int L = Integer.parseInt(str);
      	ArrayList<String> list = new ArrayList<>();
      	
      	for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        }
      	
      	Collections.sort(list);
      	for(int i = 0; i < N ; i++){
        	String input = list.get(i);
          	System.out.print(input);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.next(); str scan.next() scan.next scan int N = Integer.parseInt(str); N Integer.parseInt(str) Integer.parseInt Integer str str = scan.next() str scan.next() scan.next scan int L = Integer.parseInt(str); L Integer.parseInt(str) Integer.parseInt Integer str ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        	String input = scan.next();
          	list.add(input);
        } {
        	String input = scan.next();
          	list.add(input);
        } String input = scan.next(); input scan.next() scan.next scan list.add(input) list.add list input Collections.sort(list) Collections.sort Collections list for(int i = 0; i < N ; i++){
        	String input = list.get(i);
          	System.out.print(input);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        	String input = list.get(i);
          	System.out.print(input);
        } {
        	String input = list.get(i);
          	System.out.print(input);
        } String input = list.get(i); input list.get(i) list.get list i System.out.print(input) System.out.print System.out System System.out input String[] args args
import java.util.*;
class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String str = scan.next();
    	int N = Integer.parseInt(str);
      	str = scan.next();
      	int L = Integer.parseInt(str);
      	ArrayList<String> list = new ArrayList<>();
      	
      	for(int i = 0; i < N; i++){
        	String input = scan.next();
          	list.add(input);
        }
      	
      	Collections.sort(list);
      	for(int i = 0; i < N ; i++){
        	String input = list.get(i);
          	System.out.print(input);
        }
    }
}