import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int L = Integer.parseInt(sc.next());
    String[] strs = new String[N];
    int i;
    for(i=0;i<N;i++){
      strs[i] = sc.next();
    }
    Arrays.sort(strs);
    StringBuilder sb = new StringBuilder();
    for(i=0;i<N;i++){
      sb.append(strs[i]);
    }
    System.out.print(sb.toString());
    System.out.flush();
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int L = Integer.parseInt(sc.next());
    String[] strs = new String[N];
    int i;
    for(i=0;i<N;i++){
      strs[i] = sc.next();
    }
    Arrays.sort(strs);
    StringBuilder sb = new StringBuilder();
    for(i=0;i<N;i++){
      sb.append(strs[i]);
    }
    System.out.print(sb.toString());
    System.out.flush();
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int L = Integer.parseInt(sc.next());
    String[] strs = new String[N];
    int i;
    for(i=0;i<N;i++){
      strs[i] = sc.next();
    }
    Arrays.sort(strs);
    StringBuilder sb = new StringBuilder();
    for(i=0;i<N;i++){
      sb.append(strs[i]);
    }
    System.out.print(sb.toString());
    System.out.flush();
  } main {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int L = Integer.parseInt(sc.next());
    String[] strs = new String[N];
    int i;
    for(i=0;i<N;i++){
      strs[i] = sc.next();
    }
    Arrays.sort(strs);
    StringBuilder sb = new StringBuilder();
    for(i=0;i<N;i++){
      sb.append(strs[i]);
    }
    System.out.print(sb.toString());
    System.out.flush();
  } 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[] strs = new String[N]; strs new String[N] N int i; i for(i=0;i<N;i++){
      strs[i] = sc.next();
    } i=0; 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 StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(i=0;i<N;i++){
      sb.append(strs[i]);
    } i=0; 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.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb System.out.flush() System.out.flush System.out System System.out String[] args args
import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int L = Integer.parseInt(sc.next());
    String[] strs = new String[N];
    int i;
    for(i=0;i<N;i++){
      strs[i] = sc.next();
    }
    Arrays.sort(strs);
    StringBuilder sb = new StringBuilder();
    for(i=0;i<N;i++){
      sb.append(strs[i]);
    }
    System.out.print(sb.toString());
    System.out.flush();
  }
}
