import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  } main {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt() n sc.nextInt() sc.nextInt sc l=sc.nextInt(); l sc.nextInt() sc.nextInt sc StringBuffer sb=new StringBuffer(); sb new StringBuffer() String[] strs=new String[n]; strs new String[n] n for(int i=0;i<n;i++){
      strs[i]=sc.next();
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      strs[i]=sc.next();
    } {
      strs[i]=sc.next();
    } strs[i]=sc.next() strs[i] strs i sc.next() sc.next sc Arrays.sort(strs) Arrays.sort Arrays strs for(int i=0;i<n;i++){
      sb.append(strs[i]);
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      sb.append(strs[i]);
    } {
      sb.append(strs[i]);
    } sb.append(strs[i]) sb.append sb strs[i] strs i System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt(),l=sc.nextInt();
    StringBuffer sb=new StringBuffer();
    String[] strs=new String[n];
    for(int i=0;i<n;i++){
      strs[i]=sc.next();
    }
    Arrays.sort(strs);
    for(int i=0;i<n;i++){
      sb.append(strs[i]);
    }
    System.out.println(sb);
  }
}