(* let sl = Str.split (Str.regexp " ") @@ read_line () *)
(* let il = List.map int_of_string sl *)
(* let ar = Array.of_list il *)

(* let (a, b) = Scanf.scanf "%d %d\n" (fun a b -> a, b) *)
(* let () = Printf.printf "%d %f\n" 2 3.5 *)




let (n, l) = Scanf.scanf "%d %d\n" (fun a b -> a, b)
let s = Array.make n ""

let () =
  for i = 0 to n-1 do
    s.(i) <- read_line ()
  done

let () =
  Array.sort compare s;
  for i = 0 to n-1 do
    print_string s.(i)
  done;
  print_newline ()
