import java.util.Arrays;
import java.util.Collection;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    }

} import java.util.Arrays; Arrays java.util import java.util.Collection; Collection java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    }

} Main public static void main(String[] args) {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    } main {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    } 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 [] str = new String[n]; str new String[n] n int i=0; i 0 while (i<n)
            {
                str[i] = sc.next();
                i++;
            } i<n i n {
                str[i] = sc.next();
                i++;
            } str[i] = sc.next() str[i] str i sc.next() sc.next sc i++ i Arrays.sort(str) Arrays.sort Arrays str for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          } i=0; i=0 i 0 i<str.length i str.length str str.length i++ i++ i {
              //System.out.println(str[i]);
          } {
              //System.out.println(str[i]);
          } String str2=""; str2 "" for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          } i=0; i=0 i 0 i<str.length i str.length str str.length i++ i++ i {
              str2 = str2 + str[i];
          } {
              str2 = str2 + str[i];
          } str2 = str2 + str[i] str2 str2 + str[i] str2 str[i] str i System.out.println(str2) System.out.println System.out System System.out str2 String[] args args public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    }

} public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    }

} Main
import java.util.Arrays;
import java.util.Collection;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            Scanner sc = new Scanner(System.in);
            
            int n =sc.nextInt();
            int l =  sc.nextInt();
            String [] str = new String[n];
            
           

            int i=0;
            while (i<n)
            {
                str[i] = sc.next();
                i++;
            }
            Arrays.sort(str);
          for(i=0;i<str.length;i++)
          {
              //System.out.println(str[i]);
          }
          String str2="";
          for(i=0;i<str.length;i++)
          {
              str2 = str2 + str[i];
          }
         
          System.out.println(str2);
    }

}
