let read_lines () =
  let rec iter xs =
    try read_line() :: xs |> iter
    with End_of_file -> xs
  in iter [] |> List.rev

let split_nums str =
  Str.split (Str.regexp " ") str
  |> List.map int_of_string

let print_array a =
  let n = Array.length a in
  for i = 0 to n - 2 do
    Printf.printf "%d " a.(i)
  done;
  Printf.printf "%d\n" a.(n-1)

let insertion_sort lst =
  let array = Array.of_list lst in
  let n = Array.length array in
  for i = 1 to n - 1 do
    print_array array;
    let v = array.(i) in
    let j = ref (i - 1) in
    while !j >= 0 && array.(!j) > v do
      array.(!j+1) <- array.(!j);
      j := !j - 1;
    done;
    array.(!j+1) <- v;
  done;
  print_array array


let print_answer (x, y) =
  let fmt x =
    let s = Printf.sprintf "%.3f" x in
    if s = "-0.000" then "0.000"
    else s
  in
  Printf.printf "%s %s\n" (fmt x) (fmt y)

let () =
  let _ = read_int () in
  read_line ()
  |> split_nums
  |> insertion_sort