let rec lower_bound l r p =
  if r <= 1 + l
  then r
  else let m = (l + r) / 2 in
       if p m
       then lower_bound l m p
       else lower_bound m r p

let () = Scanf.scanf "%d\n" @@ fun n ->
  let x = lower_bound 0 n @@ fun x -> n <= x * (x + 1) / 2 in
  ignore @@ Array.fold_left (fun n x ->
    if n < x then n
    else (Printf.printf "%d\n" x; n - x)) n @@ Array.init x (fun i -> x - i)
