import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        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();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        System.out.println();
    }
    
 
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        System.out.println();
    } main {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        System.out.println();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc String[] inputs=new String[n]; inputs new String[n] n for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            inputs[i]=sc.next();
        } {
            inputs[i]=sc.next();
        } inputs[i]=sc.next() inputs[i] inputs i sc.next() sc.next sc String tmp; tmp for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        } {
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        } for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            } int j=0; int j=0; j 0 j<n-1 j n-1 n 1 j++ j++ j {
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            } {
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            } if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                } inputs[j].compareTo(inputs[j+1])>0 inputs[j].compareTo(inputs[j+1]) inputs[j].compareTo inputs[j] inputs j inputs[j+1] inputs j+1 j 1 0 {
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                } tmp=inputs[j] tmp inputs[j] inputs j inputs[j]=inputs[j+1] inputs[j] inputs j inputs[j+1] inputs j+1 j 1 inputs[j+1]=tmp inputs[j+1] inputs j+1 j 1 tmp for(String a:inputs){
            System.out.print(a);
        } String a inputs {
            System.out.print(a);
        } {
            System.out.print(a);
        } System.out.print(a) System.out.print System.out System System.out a 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();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        System.out.println();
    }
    
 
} public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        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();
        sc.nextInt();
        String[] inputs=new String[n];
        for(int i=0;i<n;i++){
            inputs[i]=sc.next();
        }
        String tmp;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-1;j++){
                if(inputs[j].compareTo(inputs[j+1])>0){
                    tmp=inputs[j];
                    inputs[j]=inputs[j+1];
                    inputs[j+1]=tmp;
                }
            }
        }
        for(String a:inputs){
            System.out.print(a);
        }
        System.out.println();
    }
    
 
}