(* O(l n log n) *)
Scanf.scanf "%d %d" @@ fun n l ->
  let ss = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s in
  Array.sort compare ss;
  Array.to_list ss |> String.concat "" |> print_endline