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;
  Array.sort compare s;
  for i = 0 to n-1 do
    print_string s.(i)
  done;
  print_newline ()
