import java.util.*;
class Main{
  public static void main(String[] a){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    String[] stringArray = new String[n];
    
    for(int i=0; i<n; i++)stringArray[i] = sc.next();
    
    Arrays.sort(stringArray);
    for(int i=0;i<n;i++)System.out.print(stringArray[i]);
  }
  
  private static String[] merge(String[] sArray){
    if(sArray.length == 1){
      return sArray;
    }else{
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    }
  }
  
  private static boolean judge(String s1, String s2){
    byte[] byte1 = s1.getBytes();
    byte[] byte2 = s2.getBytes();
    for(int i=0; i<byte1.length; i++){
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    }
    return true;
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] a){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    String[] stringArray = new String[n];
    
    for(int i=0; i<n; i++)stringArray[i] = sc.next();
    
    Arrays.sort(stringArray);
    for(int i=0;i<n;i++)System.out.print(stringArray[i]);
  }
  
  private static String[] merge(String[] sArray){
    if(sArray.length == 1){
      return sArray;
    }else{
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    }
  }
  
  private static boolean judge(String s1, String s2){
    byte[] byte1 = s1.getBytes();
    byte[] byte2 = s2.getBytes();
    for(int i=0; i<byte1.length; i++){
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    }
    return true;
  }
} Main public static void main(String[] a){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    String[] stringArray = new String[n];
    
    for(int i=0; i<n; i++)stringArray[i] = sc.next();
    
    Arrays.sort(stringArray);
    for(int i=0;i<n;i++)System.out.print(stringArray[i]);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    String[] stringArray = new String[n];
    
    for(int i=0; i<n; i++)stringArray[i] = sc.next();
    
    Arrays.sort(stringArray);
    for(int i=0;i<n;i++)System.out.print(stringArray[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 int l = Integer.parseInt(sc.next()); l Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] stringArray = new String[n]; stringArray new String[n] n for(int i=0; i<n; i++)stringArray[i] = sc.next(); int i=0; int i=0; i 0 i<n i n i++ i++ i stringArray[i] = sc.next(); stringArray[i] = sc.next() stringArray[i] stringArray i sc.next() sc.next sc Arrays.sort(stringArray) Arrays.sort Arrays stringArray for(int i=0;i<n;i++)System.out.print(stringArray[i]); int i=0; int i=0; i 0 i<n i n i++ i++ i System.out.print(stringArray[i]); System.out.print(stringArray[i]) System.out.print System.out System System.out stringArray[i] stringArray i String[] a a private static String[] merge(String[] sArray){
    if(sArray.length == 1){
      return sArray;
    }else{
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    }
  } merge {
    if(sArray.length == 1){
      return sArray;
    }else{
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    }
  } if(sArray.length == 1){
      return sArray;
    }else{
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    } sArray.length == 1 sArray.length sArray sArray.length 1 {
      return sArray;
    } return sArray; sArray {
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    } String[] array1 = new String[sArray.length/2]; array1 new String[sArray.length/2] sArray.length/2 sArray.length sArray sArray.length 2 String[] array2 = new String[sArray.length-sArray.length/2]; array2 new String[sArray.length-sArray.length/2] sArray.length-sArray.length/2 sArray.length sArray sArray.length sArray.length/2 sArray.length sArray sArray.length 2 for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      } int i=0; int i=0; i 0 i<array1.length i array1.length array1 array1.length i++ i++ i {
        array1[i] = sArray[i];
      } {
        array1[i] = sArray[i];
      } array1[i] = sArray[i] array1[i] array1 i sArray[i] sArray i for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      } int i=0; int i=0; i 0 i<array2.length i array2.length array2 array2.length i++ i++ i {
        array2[i] = sArray[array1.length+i];
      } {
        array2[i] = sArray[array1.length+i];
      } array2[i] = sArray[array1.length+i] array2[i] array2 i sArray[array1.length+i] sArray array1.length+i array1.length array1 array1.length i array1 = merge(array1) array1 merge(array1) merge array1 array2 = merge(array2) array2 merge(array2) merge array2 int i1 = 0; i1 0 int i2 = 0; i2 0 while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      } true {
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      } if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        } judge(array1[i1], array2[i2]) judge array1[i1] array1 i1 array2[i2] array2 i2 {
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        } sArray[i1+i2] = array1[i1] sArray[i1+i2] sArray i1+i2 i1 i2 array1[i1] array1 i1 i1++ i1 if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          } i1 == array1.length i1 array1.length array1 array1.length {
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          } for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            } int j=0; int j=0; j 0 j<sArray.length-i1-i2 j sArray.length-i1-i2 sArray.length-i1-i2 sArray.length sArray sArray.length i1 i2 j++ j++ j {
              sArray[i1+i2+j] = array2[i2+j];
            } {
              sArray[i1+i2+j] = array2[i2+j];
            } sArray[i1+i2+j] = array2[i2+j] sArray[i1+i2+j] sArray i1+i2+j i1+i2+j i1 i2 j array2[i2+j] array2 i2+j i2 j break; {
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        } sArray[i1+i2] = array2[i2] sArray[i1+i2] sArray i1+i2 i1 i2 array2[i2] array2 i2 i2++ i2 if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          } i2 == array2.length i2 array2.length array2 array2.length {
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          } for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            } int j=0; int j=0; j 0 j<sArray.length-i1-i2 j sArray.length-i1-i2 sArray.length-i1-i2 sArray.length sArray sArray.length i1 i2 j++ j++ j {
              sArray[i1+i2+j] = array1[i1+j];
            } {
              sArray[i1+i2+j] = array1[i1+j];
            } sArray[i1+i2+j] = array1[i1+j] sArray[i1+i2+j] sArray i1+i2+j i1+i2+j i1 i2 j array1[i1+j] array1 i1+j i1 j break; return sArray; sArray String[] sArray sArray private static boolean judge(String s1, String s2){
    byte[] byte1 = s1.getBytes();
    byte[] byte2 = s2.getBytes();
    for(int i=0; i<byte1.length; i++){
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    }
    return true;
  } judge {
    byte[] byte1 = s1.getBytes();
    byte[] byte2 = s2.getBytes();
    for(int i=0; i<byte1.length; i++){
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    }
    return true;
  } byte[] byte1 = s1.getBytes(); byte1 s1.getBytes() s1.getBytes s1 byte[] byte2 = s2.getBytes(); byte2 s2.getBytes() s2.getBytes s2 for(int i=0; i<byte1.length; i++){
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    } int i=0; int i=0; i 0 i<byte1.length i byte1.length byte1 byte1.length i++ i++ i {
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    } {
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    } if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      } (int)byte1[i] < (int)byte2[i] (int)byte1[i] byte1 i (int)byte2[i] byte2 i {
        return true;
      } return true; true if((int)byte1[i] > (int)byte2[i]){
        return false;
      } (int)byte1[i] > (int)byte2[i] (int)byte1[i] byte1 i (int)byte2[i] byte2 i {
        return false;
      } return false; false return true; true String s1 s1 String s2 s2
import java.util.*;
class Main{
  public static void main(String[] a){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    String[] stringArray = new String[n];
    
    for(int i=0; i<n; i++)stringArray[i] = sc.next();
    
    Arrays.sort(stringArray);
    for(int i=0;i<n;i++)System.out.print(stringArray[i]);
  }
  
  private static String[] merge(String[] sArray){
    if(sArray.length == 1){
      return sArray;
    }else{
      String[] array1 = new String[sArray.length/2];
      String[] array2 = new String[sArray.length-sArray.length/2];
      for(int i=0; i<array1.length; i++){
        array1[i] = sArray[i];
      }
      for(int i=0; i<array2.length; i++){
        array2[i] = sArray[array1.length+i];
      }
      array1 = merge(array1);
      array2 = merge(array2);
      int i1 = 0;
      int i2 = 0;
      while(true){
        if(judge(array1[i1], array2[i2])){
          sArray[i1+i2] = array1[i1];
          i1++;
          if(i1 == array1.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array2[i2+j];
            }
            break;
          }
        }else{
          sArray[i1+i2] = array2[i2];
          i2++;
          if(i2 == array2.length){
            for(int j=0; j<sArray.length-i1-i2; j++){
              sArray[i1+i2+j] = array1[i1+j];
            }
            break;
          }
        }
      }
      return sArray;
    }
  }
  
  private static boolean judge(String s1, String s2){
    byte[] byte1 = s1.getBytes();
    byte[] byte2 = s2.getBytes();
    for(int i=0; i<byte1.length; i++){
      if((int)byte1[i] < (int)byte2[i]){
        return true;
      }else if((int)byte1[i] > (int)byte2[i]){
        return false;
      }
    }
    return true;
  }
}
