import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.toString());
    }
} import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.toString());
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.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[] s = new String[n]; s new String[n] n for(int i = 0; i < n; i++){
            s[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
        } {
            s[i] = sc.next();
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s StringBuilder sd = new StringBuilder(); sd new StringBuilder() for(String v: s){
            sd.append(v);
        } String v s {
            sd.append(v);
        } {
            sd.append(v);
        } sd.append(v) sd.append sd v System.out.println(sd.toString()) System.out.println System.out System System.out sd.toString() sd.toString sd String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.toString());
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.toString());
    }
} Main
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        StringBuilder sd = new StringBuilder();
        for(String v: s){
            sd.append(v);
        }
        System.out.println(sd.toString());
    }
}