import java.util.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next()),l=Integer.parseInt(sc.next());
        String[] s = new String[n];
        for(int i =0;i<n;i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for(int i =0;i<n;i++){
            System.out.print(s[i]);
        }
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next()),l=Integer.parseInt(sc.next());
        String[] s = new String[n];
        for(int i =0;i<n;i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for(int i =0;i<n;i++){
            System.out.print(s[i]);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next()),l=Integer.parseInt(sc.next());
        String[] s = new String[n];
        for(int i =0;i<n;i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for(int i =0;i<n;i++){
            System.out.print(s[i]);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next()),l=Integer.parseInt(sc.next());
        String[] s = new String[n];
        for(int i =0;i<n;i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for(int i =0;i<n;i++){
            System.out.print(s[i]);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()) n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc l=Integer.parseInt(sc.next()); l Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next 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 for(int i =0;i<n;i++){
            System.out.print(s[i]);
        } int i =0; int i =0; i 0 i<n i n i++ i++ i {
            System.out.print(s[i]);
        } {
            System.out.print(s[i]);
        } System.out.print(s[i]) System.out.print System.out System System.out s[i] s i String[] args args
import java.util.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next()),l=Integer.parseInt(sc.next());
        String[] s = new String[n];
        for(int i =0;i<n;i++){
            s[i] = sc.next();
        }
        Arrays.sort(s);
        for(int i =0;i<n;i++){
            System.out.print(s[i]);
        }
    }
}