import java.util.Scanner;

class Main{
  public static void main(String[] args){
    int n = 0;
    int k = 0;
    Scanner s = new Scanner(System.in);
    n = Integer.parseInt(s.next());
    k = Integer.parseInt(s.next());
    String buffer = "";
    String[] array = new String[n];
    for(int i=0; i<n; i++){
      array[i] = s.next();
    }

    for(int i=0; i<n-1; i++){
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    }

    for(int i=0; i<n; i++){
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    }
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    int n = 0;
    int k = 0;
    Scanner s = new Scanner(System.in);
    n = Integer.parseInt(s.next());
    k = Integer.parseInt(s.next());
    String buffer = "";
    String[] array = new String[n];
    for(int i=0; i<n; i++){
      array[i] = s.next();
    }

    for(int i=0; i<n-1; i++){
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    }

    for(int i=0; i<n; i++){
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    }
  }
} Main public static void main(String[] args){
    int n = 0;
    int k = 0;
    Scanner s = new Scanner(System.in);
    n = Integer.parseInt(s.next());
    k = Integer.parseInt(s.next());
    String buffer = "";
    String[] array = new String[n];
    for(int i=0; i<n; i++){
      array[i] = s.next();
    }

    for(int i=0; i<n-1; i++){
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    }

    for(int i=0; i<n; i++){
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    }
  } main {
    int n = 0;
    int k = 0;
    Scanner s = new Scanner(System.in);
    n = Integer.parseInt(s.next());
    k = Integer.parseInt(s.next());
    String buffer = "";
    String[] array = new String[n];
    for(int i=0; i<n; i++){
      array[i] = s.next();
    }

    for(int i=0; i<n-1; i++){
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    }

    for(int i=0; i<n; i++){
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    }
  } int n = 0; n 0 int k = 0; k 0 Scanner s = new Scanner(System.in); s new Scanner(System.in) n = Integer.parseInt(s.next()) n Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s k = Integer.parseInt(s.next()) k Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s String buffer = ""; buffer "" String[] array = new String[n]; array new String[n] n for(int i=0; i<n; i++){
      array[i] = s.next();
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      array[i] = s.next();
    } {
      array[i] = s.next();
    } array[i] = s.next() array[i] array i s.next() s.next s for(int i=0; i<n-1; i++){
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    } int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    } {
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    } for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      } int j=n-1; int j=n-1; j n-1 n 1 i<j i j j-- j-- j {
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      } {
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      } if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        } array[j].compareTo(array[j-1])<0 array[j].compareTo(array[j-1]) array[j].compareTo array[j] array j array[j-1] array j-1 j 1 0 {
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        } buffer = array[j] buffer array[j] array j array[j] = array[j-1] array[j] array j array[j-1] array j-1 j 1 array[j-1] = buffer array[j-1] array j-1 j 1 buffer for(int i=0; i<n; i++){
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    } {
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    } if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      } i==n-1 i n-1 n 1 {
        System.out.println(array[i]);
      } System.out.println(array[i]) System.out.println System.out System System.out array[i] array i {
        System.out.print(array[i]);
      } System.out.print(array[i]) System.out.print System.out System System.out array[i] array i String[] args args
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    int n = 0;
    int k = 0;
    Scanner s = new Scanner(System.in);
    n = Integer.parseInt(s.next());
    k = Integer.parseInt(s.next());
    String buffer = "";
    String[] array = new String[n];
    for(int i=0; i<n; i++){
      array[i] = s.next();
    }

    for(int i=0; i<n-1; i++){
      for(int j=n-1; i<j; j--){
        if(array[j].compareTo(array[j-1])<0){
          buffer = array[j];
          array[j] = array[j-1];
          array[j-1] = buffer;
        }
      }
    }

    for(int i=0; i<n; i++){
      if(i==n-1){
        System.out.println(array[i]);
      }else{
        System.out.print(array[i]);
      }
    }
  }
}
