import java.util.*;
public class Main {
    public static void main(String [] args){
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    }
} import java.util.*; util.* java public class Main {
    public static void main(String [] args){
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    }
} Main public static void main(String [] args){
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    } main {
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int N = input.nextInt(); N input.nextInt() input.nextInt input int L = input.nextInt(); L input.nextInt() input.nextInt input String a[] = new String[N]; a new String[N] N String s; s for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        } int i = 0; int i = 0; i 0 i <N i N i++ i++ i {
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        } {
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        } s = input.next() s input.next() input.next input a[i]=s a[i] a i s Arrays.sort(a) Arrays.sort Arrays a for (String a1 : a) {
            System.out.print(a1);
        } String a1 a {
            System.out.print(a1);
        } {
            System.out.print(a1);
        } System.out.print(a1) System.out.print System.out System System.out a1 System.out.println() System.out.println System.out System System.out String [] args args public class Main {
    public static void main(String [] args){
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    }
} public class Main {
    public static void main(String [] args){
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    }
} Main
import java.util.*;
public class Main {
    public static void main(String [] args){
        Scanner input = new Scanner(System.in);
        
        int N = input.nextInt();
        int L = input.nextInt();
        
        String a[] = new String[N];
        String s;
        for(int i = 0; i <N; i++){
            s = input.next();
            //if(s.length()==L)
                a[i]=s;
        }
        Arrays.sort(a);
        for (String a1 : a) {
            System.out.print(a1);
        }
        
        System.out.println();
        
        /*
        for(int i = 0; i <a.length; i++)
             System.out.print(a[i]);
        */
    }
}
