import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    } main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    } 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 ans[] = new String[n]; ans new String[n] n for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          ans[i] = sc.next();
        } {
          ans[i] = sc.next();
        } ans[i] = sc.next() ans[i] ans i sc.next() sc.next sc Arrays.sort(ans) Arrays.sort Arrays ans for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          System.out.print(ans[i]);
        } {
          System.out.print(ans[i]);
        } System.out.print(ans[i]) System.out.print System.out System System.out ans[i] ans 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 sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
		int l = sc.nextInt();
        String ans[] = new String[n];
        for(int i = 0;i < n;i++){
          ans[i] = sc.next();
        }
		Arrays.sort(ans);
        
        for(int i = 0;i < n;i++){
          System.out.print(ans[i]);
        }
          System.out.println();
    }
}