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[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    }
} 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[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); 
        int L = sc.nextInt();
        String[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    } main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); 
        int L = sc.nextInt();
        String[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    } 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[] s = new String[N]; s new String[N] N String[] S = new String[N]; S new String[N] N for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
          s[i] = sc.next();
          S[i] = s[i];
        } {
          s[i] = sc.next();
          S[i] = s[i];
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc S[i] = s[i] S[i] S i s[i] s i Arrays.sort(S) Arrays.sort Arrays S String X = S[0]; X S[0] S 0 for(int i=1; i<N; i++){
          X = X + S[i];
        } int i=1; int i=1; i 1 i<N i N i++ i++ i {
          X = X + S[i];
        } {
          X = X + S[i];
        } X = X + S[i] X X + S[i] X S[i] S i System.out.println(X) System.out.println System.out System System.out X 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[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(); 
        int L = sc.nextInt();
        String[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    }
} 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[] s = new String[N];
        String[] S = new String[N];
      
        for(int i=0; i<N; i++){
          s[i] = sc.next();
          S[i] = s[i];
        }
      
        Arrays.sort(S);

        String X = S[0];
        for(int i=1; i<N; i++){
          X = X + S[i];
        }
        System.out.println(X);
    }
}