import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  }
} Main public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  } main {
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) final int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc final int L=sc.nextInt(); L sc.nextInt() sc.nextInt sc String[] s=new String[N]; s new String[N] N for(int i=0;i<N;i++){
      s[i]=sc.next();
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      s[i]=sc.next();
    } {
      s[i]=sc.next();
    } s[i]=sc.next() s[i] s i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s for(int i=1;i<N;i++){
      s[0]+=s[i];
    } int i=1; int i=1; i 1 i<N i N i++ i++ i {
      s[0]+=s[i];
    } {
      s[0]+=s[i];
    } s[0]+=s[i] s[0] s 0 s[i] s i System.out.println(s[0]) System.out.println System.out System System.out s[0] s 0 String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    final int N=sc.nextInt();
    final int L=sc.nextInt();
    String[] s=new String[N];
    for(int i=0;i<N;i++){
      s[i]=sc.next();
    }
    Arrays.sort(s);
    for(int i=1;i<N;i++){
      s[0]+=s[i];
    }
    System.out.println(s[0]);
  }
}